Dock
A dock that magnifies the icon under the pointer, the way a desktop one does.
PaletteCalamansi
Glide along the dock
Each icon measures its distance from your pointer and springs to meet it.
Home selected
Installation
npx shadcn@latest add fujiDevv/calamansi-ui/dockHow to use
demo.tsx
import { Dock, DockItem } from "@/components/ui/dock"import { House, Search, Heart } from "lucide-react"export function Demo() {return (<Dock><DockItem label="Home"><House className="size-6" /></DockItem><DockItem label="Search"><Search className="size-6" /></DockItem><DockItem label="Saved"><Heart className="size-6" /></DockItem></Dock>)}
Props
Options you can pass to customize this component.
children*requiredReactNodeDockItem elements.
reachoptionalnumberHow far from the pointer, in pixels, an item starts growing.
sizeoptionalnumberItem size at rest, in pixels.
magnifyoptionalnumberItem size under the pointer, in pixels.
panelHeightoptionalnumberFixed height of the dock border box in pixels. Defaults to size + 16.
variantoptionalwhitecalamansislatecitrusSurface palette. Calamansi is the default slab; White is white in light mode and near-black in dark.
classNameoptionalstringExtra classes merged onto the dock.
labeloptionalstringDockItem only. The label shown above the item on hover.
onClickoptional() => voidDockItem only. Called when the item is pressed.
Dependencies
motion
License & Usage
- •Free to use and modify in personal and commercial projects.
- •Attribution to Calamansi UI is appreciated when using a component.
- •Please do not resell the components as your own kit.