Skip to content
VenusUI
Get started

Dock

A row of icons that magnify as the mouse approaches, like the macOS dock.

Preview

Installation

npx shadcn@latest add @venusui/dock

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/dock.tsx

Usage

The code behind the preview above.

dock-demo.tsx

import { Calendar, Folder, Home, Mail, Search, Settings } from "lucide-react"

import { Dock } from "@/components/ui/dock"

export default function DockDemo() {
  return (
    <Dock
      items={[
        { label: "Home", icon: <Home />, href: "#" },
        { label: "Search", icon: <Search />, href: "#" },
        { label: "Mail", icon: <Mail />, href: "#" },
        { label: "Calendar", icon: <Calendar />, href: "#" },
        { label: "Files", icon: <Folder />, href: "#" },
        { label: "Settings", icon: <Settings />, href: "#" },
      ]}
    />
  )
}

API reference

PropTypeDefaultDescription
items{ label: string; icon: ReactNode; href?: string; onClick?: () => void }[]—Dock items. Each becomes a link (with href) or a button. Required.
sizenumber40Item size at rest, in pixels.
magnificationnumber64Item size right under the pointer, in pixels.
distancenumber140How far, in pixels, the magnification reaches.
labelstring"Dock"Accessible name for the navigation.
classNamestring—Classes for the dock bar.

Only the props above.

Requirements

  • The motion package. The CLI installs it.
  • React 19 and Tailwind CSS v4.

Customization

  • Fix it to the bottom of the screen: wrap it in fixed inset-x-0 bottom-4 flex justify-center.
  • Use any icon component; it is sized to 45% of the item.

Accessibility

  • It is a labelled nav list; each item is a named link or button with a tooltip on hover and focus.
  • Magnification follows the mouse only, and is off when the user prefers reduced motion.

Troubleshooting

Tooltips are cut off.
They sit above the dock. Leave about 2.5rem of space above it, or remove overflow-hidden from its container.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

Animated Tabs

Navigation

Tabs with a sliding underline and fading panels, following the WAI-ARIA tabs pattern.

Loading preview

Camera Shutter

Interactive

A lens with a working iris: blades close to the chosen aperture and snap shut when you release the shutter.