forever components

Drag & Reorder

Carousel Throw

Seven colored cards orbit a glowing hub in a radial ring; drag to fling with angular inertia, release to snap to the nearest card under the marker.

cssmedium complexitymoderate motionpointer

Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited

Live demo — the real component, running in a sandbox. One self-contained HTML file, zero dependencies. Open it on the canvas →
Worth keeping? Votes steer what gets built next — sign in to cast one, free to read

When to use it

Card pickers, radial menus, or onboarding flows needing a tactile selection carousel with satisfying throw-and-snap physics.

When not to

Lists with more than ~9 items where radial layout crowds cards. Contexts needing immediate stable selection without motion.

Working with an AI agent

Every component ships agent-ready metadata. An example instruction for this one:

Change card count to 5 by setting N=5 and trimming PAL to 5 entries, then increase orbit radius to 42 by setting R=42. 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

  • card count (N=7)
  • orbit radius in % (R=37)
  • color palette (PAL array)
  • spring stiffness (diff*0.10) and damping (vel*0.74)
  • fling velocity scale (STEP*0.42 in keydown)
  • auto-demo idle threshold (idle>150)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • IIFE wrapper
  • visibilitychange pause/resume
  • prefers-reduced-motion early-exit guard
  • counterRotate() keeping glyphs upright during ring spin
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • Cards counter-rotate to stay upright — removing counterRotate() will spin the labels with the ring
  • Angular drag uses pointer angle from center; very small ring sizes reduce drag precision
  • Auto-demo fires after idle timeout — remove the demoT/idle block before shipping in production

carouseldraginertiaradialphysicssnapui-control

More Drag & Reorder components

  • FLIP Reorder7-row list reorders via FLIP spring physics on drag or arrow-key input; lifted card gains glow outline while others spring to new slots. Auto-demos when idle.
  • Kanban MoveThree-column kanban board where a cyan card lifts and spring-animates between lanes via FLIP. Auto-demos on a timer; supports arrow keys and horizontal drag.
  • Pull to RefreshA 5-row canvas list springs down on drag, revealing diagonal bars and a rotating geometric indicator; releasing past threshold triggers a 1.5s sync spinner.
  • Sortable Grid3x3 grid of colored numbered tiles that spring-animate into position as tiles are dragged or swapped; auto-shuffles on idle as a demo.
  • Snap SliderOchre-accent range slider with 9 tick detents; thumb flicks with spring momentum and rubber-bands at ends. Self-demos on idle, accepts keyboard input.
  • Dual RangeCanvas dual-range slider with two spring-driven thumbs (white lo, amber hi), hatched fill, delta readout, and tick marks. Auto-breathes when idle.