Skip to content
synccn

Dock

App dock that magnifies icons near the pointer.

Installation

$ pnpm dlx shadcn@latest add @synccn/dock

First time in this project? Connect synccn with one command.

Usage

import { Dock } from "@/components/ui/dock";<Dock items={apps} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

Dock

Dock with magnification: icons grow based on their distance to the pointer. items: [{ label, icon, onClick?, active? }]

  • itemsrequired
    { label: string; icon: React.ElementType; onClick?: () => void; active?: boolean }[]

    Apps in the dock.

  • base
    number

    Default 40

    Icon size at rest, in pixels.

  • magnify
    number

    Default 64

    Icon size under the pointer, in pixels.

  • distance
    number

    Default 120

    Pixels from the pointer where magnification starts.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-label
  • Shows a visible focus ring for keyboard users