Skip to content
Cuelark UI
NavigationAnimated

Dock

macOS-style dock with magnifying icons and labels.

A dock is an app-style launcher whose icons swell as the pointer approaches and neighbours make room, like the macOS Dock. Labels appear on hover and focus, active items get a dot, and keyboard focus lifts items too.

Preview

Installation

pnpm dlx shadcn@latest add https://ui.cuelark.com/r/dock.json

The CLI also installs the Cuelark theme tokens, the GSAP motion layer. With the @cuelark namespace configured, use @cuelark/dock.

Builds on: motion

Usage

import { Dock, DockItem } from "@/components/ui/dock";

<Dock>
  <DockItem label="Home"><HomeIcon /></DockItem>
</Dock>

Motion

How it moves

Items scale by distance to the pointer with a cosine falloff, eased by GSAP. Keyboard focus lifts an item too.

Scale it with --cl-motion (0 off, 1 default, 1.5 expressive) on any ancestor. Reduced-motion preferences always switch it off.

API reference

Dock

PropTypeDefaultDescription
sizenumber40Resting item size (px).
magnificationnumber1.6Peak size multiplier.
distancenumber120Falloff radius (px).

DockItem

PropTypeDefaultDescription
labelstring—Tooltip and accessible name.
activeboolean—Shows the active dot.
asChildboolean—Render a link.

Accessibility

  • A <nav> of buttons, each with an accessible name.
  • With motion off it is a plain toolbar.

FAQ

Also searched as: macos dock react · dock component · magnification dock · animated dock · app launcher bar