GodUI

Dock

A macOS-style dock whose items magnify with spring physics as the pointer moves across them.

Finder
9:41
Overview
MRR
$48.2k
Users
12,840
Churn
1.2%

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/dock.json"

Dock tracks the pointer and magnifies each DockItem based on its distance from the cursor, using a spring (mass 0.1, stiffness 170, damping 12) so neighbors ripple smoothly. Labels appear above the hovered item.

Usage

tsx
 
import { Dock, DockItem } from "@/components/godui/dock";
tsx
 
<Dock>
  <DockItem label="Home">
    <HomeIcon />
  </DockItem>
  <DockItem label="Search">
    <SearchIcon />
  </DockItem>
</Dock>

Tuning the magnification

tsx
 
<Dock baseSize={44} magnification={96} distance={180} />

Props

Dock

PropTypeDefaultDescription
baseSizenumber44Resting size of each item in pixels.
magnificationnumber72Maximum magnified size in pixels at the pointer.
distancenumber140Pointer distance over which items are affected.

DockItem

PropTypeDefaultDescription
labelReactNodeLabel shown above the item on hover.

Both components forward every standard <div> attribute to their root element. DockItem must be rendered inside a Dock.

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub