Vibe Design Tips

항목이 비켜 주는 드래그 정렬

005 Drag Ripple

항목이 비켜 주는 드래그 정렬

모션인터랙션

드래그 정렬의 커서, 놓을 위치를 표시하는 삽입선, 양옆 요소가 비켜 주는 동작을 다루며, 목록, 칸반, 가로 배열에 적합합니다.

많은 드래그 정렬은 끄는 동안 다른 요소가 움직이지 않다가 손을 떼고 나서야 목록이 갑자기 재배치되어, 어느 두 항목 사이에 놓였는지는 손을 뗀 뒤에야 확인할 수 있습니다. 다음 다섯 가지로 손을 떼기 전에 결과를 보여 줍니다.

  1. 커서: 끌 수 있는 모든 요소에 설정합니다. 호버하면 손 모양, 끄는 동안에는 잡은 손 모양을 표시해, 누르기 전부터 끌 수 있다는 것을 알게 합니다.
  2. 끌고 있는 요소: 포인터를 따라가되 놓을 위치는 피해서 삽입선을 가리지 않게 합니다. 가로 배열에서는 위로 떠오르고, 세로 목록에서는 한쪽으로 비켜나며 약 90%로 작아집니다. 원래 자리는 그에 맞춰 메워집니다.
  3. 삽입선: 놓을 위치를 표시하는 아주 옅고 가는 선으로, 색은 텍스트 색상의 약 15%입니다. 가로 배열에서는 세로로, 목록에서는 가로로 놓입니다. 나타날 때는 가운데에서 양 끝으로 펼쳐지고, 놓을 위치가 바뀌면 그쪽으로 평행 이동합니다. 요소의 원래 자리에는 표시하지 않습니다.
  4. 비켜 주기: 삽입선 양쪽의 요소가 바깥으로 비켜나며, 가까울수록 더 많이, 더 일찍 움직입니다. 이동 거리 = 10px × 0.7ⁿ, 지연 = 24ms × n이며, n은 삽입선과의 사이에 있는 요소 수로 바로 옆 요소는 0입니다. 아이콘은 10px, 카드는 8px부터 시작합니다.
  5. 놓기와 취소: 손을 떼면 요소가 빈자리에 들어가고, 나머지 요소는 스프링 애니메이션으로 새 위치로 이동합니다. Esc를 누르거나 목록 밖에서 손을 떼면 취소로 보고 모든 요소를 원래 위치로 되돌립니다.

또한 요소는 transform으로만 움직이고 레이아웃은 바꾸지 않습니다. 정렬은 키보드로도 할 수 있어야 합니다. ‘동작 줄이기’가 켜져 있으면 삽입선만 남깁니다.

매개변수

이동 거리
아이콘 10px, 카드 8px, 한 칸 멀어질 때마다 × 0.7
지연
한 칸 멀어질 때마다 +24ms
스프링
거의 오버슈트하지 않으며, 약 0.25s 만에 멈춤
삽입선
텍스트 색상의 약 15%

함께 제공하는 Prompt는 프로젝트의 기존 드래그 로직을 재사용해, 이 효과를 지정한 목록, 행, Dock에 추가합니다.

PromptClaude Code, Cursor 같은 Agent에 붙여 넣어 사용하세요
Make drag-to-reorder in my product feel like this. Apply it to the lists,
rows and docks I name, and reuse any drag helper the project already has.

1. Cursor: a pointing hand over anything draggable, a grabbing hand while
   dragging.
2. Lift: the picked item follows the pointer, raised off the list so it
   never hides where it will land: above a horizontal row, or pulled aside
   and shrunk to about 90% in a vertical list. Its old slot closes up.
3. Drop hint: a faint, thin line in the gap where it will land (vertical in
   a row, horizontal in a list), about 15% of the text color. It grows from
   its middle when it appears and glides to each new gap. No line over the
   item's own slot.
4. Ripple: items on both sides of the line lean away from it. Counting n
   from the line (0 = the item touching it), item n moves
   A x 0.7^n (A is about 10px for icons, 8px for cards)
   and starts 24ms x n later, on a quick spring that barely overshoots and
   settles in about 0.25s. Nearer items move sooner and further, so the
   push spreads out like a ripple.
5. Drop: the item takes the gap and every item springs into its new place.
   Escape or dropping outside the list cancels, and everything springs back.
6. Give each motion its own curve (hand-like for the pointer, a small pop
   for the lift, springs for settling) instead of one ease-out everywhere.

Move things with transforms, not layout. Let the keyboard reorder too, and
with reduced motion keep only the line.