Installation
$ pnpm dlx shadcn@latest add @synccn/dockFirst 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? }]
PropTypeDescription
- itemsrequired
{ label: string; icon: React.ElementType; onClick?: () => void; active?: boolean }[]Apps in the dock.
- base
numberDefault
40Icon size at rest, in pixels.
- magnify
numberDefault
64Icon size under the pointer, in pixels.
- distance
numberDefault
120Pixels from the pointer where magnification starts.
- className
stringExtra 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
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
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
More navigation
BreadcrumbPath to the current page, with chevrons or slashes.PaginationPage numbers with ellipses for long ranges.StepperProgress through a multi-step flow.Navigation MenuSite navigation with mega-menu panels.SidebarCollapsible app sidebar with groups, badges and nested items.Scroll ProgressReading progress bar for the page or any scroll container.