REFERENCE
- Gallery page: https://magpui.com/en/i/rows-glide-into-pinned-group-ef1acd
- First frame (image): https://dnioievkvxejjbxgwvko.supabase.co/storage/v1/object/public/media/rows-glide-into-pinned-group-ef1acd/shot.jpg
- Clip (mp4): https://dnioievkvxejjbxgwvko.supabase.co/storage/v1/object/public/media/rows-glide-into-pinned-group-ef1acd/clip.mp4
- Original post: https://animate-ui.com/docs/primitives/animate-ui/pinned-list by Skyleen · based on @arhamkhnz
Before building, download the first frame and look at it. If ffmpeg is available, download the clip and extract frames (ffmpeg -i clip.mp4 -vf fps=2 frame-%02d.png), then study the motion frame by frame. Match what you see; the text below describes it, the frames are the truth.
BUILD: Recreate the pin-and-unpin interaction for a small two-group navigation list. The selected row travels continuously between Pinned and All while neighboring rows shift to make room. Rebuild only this behavior using the existing project components, not a documentation page or complete sidebar.
DESIGN SYSTEM: The reference list is about 240px wide. Rows are 48px tall with 12px corners, 16px horizontal padding and 8px gaps. Separate the groups by about 24px. Use white #FFFFFF background, pale gray #F4F5F4 rows, near-black #1D211F 14px text and #858B86 12px section labels. Place a 32px white rounded icon button at the right, containing a 16px outlined pin or unpin icon.
MOTION: On pin or unpin, use a shared-layout spring so the row moves to its new position above neighboring rows rather than fading out and remounting. The source documentation specifies stiffness 320, damping 25, mass 0.8; use these as an initial tuning. Other rows smoothly shift to open the destination gap. Label disappearance when a group empties uses opacity over 220ms and cubic-bezier(0.23,1,0.32,1); its layout follows the same spring. Press feedback scales the trigger to 0.97; hover does not scale. Keep transitions interruptible during rapid toggles.
SECTIONS: Initial state has two pinned rows and two regular rows. A pin action moves its row into Pinned; unpin returns it to All. Empty group labels collapse gracefully. Pin icon and accessible action label reflect the current state.
IMPLEMENTATION: Use React and Motion LayoutGroup with stable item IDs and shared layoutId across groups. Own the pinned state in the parent, preserving focus on the moving row trigger. Use native buttons with explicit Pin or Unpin accessible names; show a visible focus indicator. Prefer one keyed identity per logical item and avoid duplicating focusable controls during transitions. Under prefers-reduced-motion, move rows immediately with no scaling. Bound the list width by its container on narrow screens.
ADAPT TO THE PROJECT: Reuse the existing tokens, components and fonts. Map these estimated colors to nearby project tokens. Do not copy source logos, brand names, photos or illustrations; use placeholders.
SUCCESS CHECK:
- Pin and unpin preserve row identity and focus as the row crosses groups.
- Neighboring rows make space with no duplicates or lingering gaps.
- Empty groups, rapid repeated clicks and reduced motion all remain usable.