Components
Dock
A row of icons that grow as the cursor passes.
<Dock items={items} />Installation
npx shadcn@latest add https://ui.zjkm.tech/r/dock.jsonimport { Dock } from "@/components/dock"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
A row of app icons that grow as the mouse passes over them, with each name shown above on hover and keyboard focus.
import { HugeiconsIcon } from "@hugeicons/react";
import { Mail01Icon, MusicNote01Icon } from "@hugeicons/core-free-icons";
import { Dock } from "@/components/dock";
export function AppDock() {
return <Dock items={[{ label: "Mail", href: "/mail", icon: <HugeiconsIcon icon={Mail01Icon} size={24} /> }, { label: "Music", href: "/music", icon: <HugeiconsIcon icon={MusicNote01Icon} size={24} /> }]} />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | { label, href, icon }[] | The apps. | |
magnify | number | 1.6 | How much the icon under the cursor grows. |
label | string | "Dock" | Accessible name. |
className | string | Classes for the root element. |
With reduced motion, icons don't grow.