Skip to Content
zjkm-ui
Components

Dock

A row of icons that grow as the cursor passes.

Props
1.6
<Dock items={items} />

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/dock.json
import { 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

PropTypeDefaultDescription
items{ label, href, icon }[]The apps.
magnifynumber1.6How much the icon under the cursor grows.
labelstring"Dock"Accessible name.
classNamestringClasses for the root element.

With reduced motion, icons don't grow.

On this page