Skip to content
Interactive

FloatingDock

A row of icons that swell as the pointer passes, in a wave that follows it. The dock keeps its place in the page while it grows. Keyboard focus swells an icon too and shows its name.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
itemsFloatingDockItem[]โ€”Links: label, href and icon. An svg works best.
activestringโ€”href of the active link at start. Leave out for no marker.
onSelect(item, e) => voidโ€”Click handler. Call e.preventDefault() to stay on the page.
sizenumber44Icon size at rest in pixels. Icons at rest set the dock's width.
magnifynumber1.7How many times bigger the icon under the pointer gets.
rangenumber130Pixels from the pointer where icons start to grow.
accentstring"#a78bfa"Colour of the active marker.
labelstring"Dock"Read by screen readers.
classNamestringdark glassLook of the bar. To float it, wrap it in a fixed box.