Drag & Reorder
Magnetic Kanban Swimlanes
Two-lane kanban board: lift a card and a dashed placeholder snaps between lanes as you drag; lane counts update on drop.
cssmedium complexitymoderate motionpointeraccessible
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Two-lane boards, triage queues and any card-moving UI where each card needs a drag route and an arrow-key route.
When not to
Boards with many lanes or hundreds of cards, or anywhere moves must be saved: card positions live only in the DOM.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Replace the three .mks-card rows with your own cards, rename the lanes in the .mks-col aria-labels and .mks-head text, or change the demo order in ORDER. The accent is --accent (dark #8A9A3B, light #5A6A1D). Keep the arrow-key handler, syncCounts(), the #mks-status live region and the demo-v1 lifecycle. Set aria-disabled="true" on #mks-board for the disabled look. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:forever:theme} postMessage switches at runtime.
Safe to edit
- Forever Opus tokens on :root (--bg, --surface*, --text*, --border*, --accent) — one moss accent, no gradients
- copy and data values in markup/script
Keep intact
- demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions
- theme hook: ?theme= bootstrap, forever:theme message listener and :root[data-theme="light"] tokens
- IIFE wrapper, visibilitychange sleep, prefers-reduced-motion guard, time-based (dt) animation
Known limitations
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
- No keyboard reorder yet: cards are focusable but cannot be moved by keyboard.
More Drag & Reorder components
- Kanban MoveThree-column kanban board where a verdigris card lifts and spring-animates between lanes via FLIP. Idle demo stops after first input; supports arrow keys,…
- Pull to RefreshA 5-row canvas list springs down on drag, revealing diagonal bars and a rotating geometric indicator in verdigris and red; releasing past threshold…
- Sortable Grid3x3 grid of colored numbered tiles that spring-animate into position as tiles are dragged or swapped; initial idle shuffle stops after first input.
- Dual RangeCanvas dual-range slider with two spring-driven thumbs (white lo, amber hi), hatched fill, delta readout, and tick marks. Initial breathing stops after…
- Carousel ThrowSeven colored cards orbit a ringed hub in a radial ring; drag to fling with angular inertia, release to snap to the nearest card under the marker.
- Drag HandleA vertical list of dark rows with grip handles that lift, take a teal ring and spring into place when dragged or arrow-keyed to reorder.