Special/Dock

Dock

macOS-style icon dock with spring-physics magnification. Nearby icons scale up smoothly as the cursor moves along the dock — powered by real spring animations, not CSS transitions.

import { Dock } from "@animui/ui"

Basic

Hover over the dock and move left/right to see spring magnification in action.

Icon structure

Each icon is a full w-full h-full div inside the icon container. This lets you style app-icon aesthetics independently.

{
  id: "finder",
  label: "Finder",
  icon: (
    <div className="w-full h-full rounded-2xl bg-blue-500 flex items-center justify-center shadow-inner">
      <FolderOpen className="h-1/2 w-1/2 text-white" />
    </div>
  ),
}

DockItem props

PropTypeDefaultDescription
idstringUnique identifier.
iconReactNodeIcon element — typically a div with bg + icon inside.
labelstringTooltip text shown on hover.
onClick() => voidClick handler.
classNamestringExtra classes for the icon container.

Dock props

PropTypeDefaultDescription
itemsDockItem[]Array of items to display in the dock.
iconSizenumber52Base size of each icon in pixels.
magnificationnumber1.9Scale factor at cursor center (1 = no magnification).
distancenumber110Pixel radius of the magnification falloff.
variant"glass" | "solid" | "minimal""glass"Visual style of the dock background.
classNamestringAdditional classes.
© 2026 Steal Shadow. MIT License.Report an issue