Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Dock

Pro

A macOS-style dock whose icons scale with pointer proximity.

Installation

pnpm dlx shadcn@latest add @viewport/dock

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

<Dock>

PropTypeDefault
sizenumber

Resting icon size in pixels.

44
magnifynumber

Icon size at the pointer in pixels.

68
distancenumber

Pixels from the pointer over which icons scale.

130
labelstring

Accessible name for the toolbar.

"Dock"
classNamestring—
children*React.ReactNode—

<DockItem>

PropTypeDefault
label*string

Tooltip text and accessible name.

"Dock"
activeboolean

Shows the running-app indicator.

—
children*React.ReactNode—

Accessibility

  • Exposed as a toolbar with an accessible name.
  • Every item is a labelled button; tooltips also show on keyboard focus.
  • Icons stay at rest size for touch input and under reduced motion.