← All components
Interaction / component

Dock

A compact toolbar that magnifies nearby actions with a responsive spring.

PLAYGROUND
Live preview
Preparing preview…

Take it with you.

SOURCE ACCESS

Preview freely. Unlock the files.

Enter the shared password to copy the complete source, download every file, and install components in your app.

Access lasts 24 hours. Your preview settings stay with you.

Component notes

  • Demo.tsx contains the complete interactive example.
  • Reduced motion renders a static state. Paused, hidden and offscreen instances stop requesting animation frames.
  • Arrow keys, Home and End move focus; Enter and Space activate native buttons. dockHeight reserves space so magnification does not move adjacent content. Large item collections scroll horizontally.
React 19Pointer Events

React Bits · MIT with Commons Clause. Used with explicit project permission; see bundled notice.

Props

PropTypeDefaultDescription
baseItemSizenumber50Item size
magnificationnumber70Magnification
distancenumber200Influence distance
panelHeightnumber68Panel height
dockHeightnumber256Reserved height
itemsDockItem[]Home, Library, Saved, SettingsEach item has icon: ReactNode, label: string, optional onClick and className.
spring{ mass?: number; stiffness?: number; damping?: number }{ mass: 0.1, stiffness: 150, damping: 12 }Spring physics for item magnification.
onSelect(index: number, item: DockItem) => voidundefinedRuns after the selected item callback.
pausedbooleanfalseFreeze decorative motion; controls remain usable.
replayTokennumber0Change to reset decorative motion.
classNamestring''Additional outer classes.