Installation
npx shadcn@latest add https://chamaac.com/r/dock.json
Props
| Prop | Type | Default | Description |
|---|
| children* | React.ReactNode | - | Dock items as children. Use DockIcon, DockItem (for dropdowns), and DockLink components to compose the dock navigation. |
| closeDelay | number | 100 | Delay in milliseconds before closing dropdown menus when mouse leaves |
| bottomOffset | string | "60px" | CSS value for the bottom offset of the dock navigation |
| activePage | string | - | Optional path to determine which menu items should be marked as active. If not provided, uses the current pathname from Next.js router. |
| className | string | "" | Custom class names for styling the dock container |
DockIcon
Icon button component for the dock
Props
| Prop | Type | Default | Description |
|---|
| icon* | React.ReactNode | - | SVG icon or React element to display |
| href* | string | - | URL to navigate to when clicked |
| className | string | "" | Custom class names for styling |
DockItem
Dropdown menu component for the dock
Props
| Prop | Type | Default | Description |
|---|
| label* | string | - | Label text for the dropdown trigger |
| children* | React.ReactNode | - | DockDropdownItem components to display in the dropdown menu |
| id | string | - | Optional unique identifier. If not provided, generated from label. |
| className | string | "" | Custom class names for styling |
DockDropdownItem
Individual item within a DockItem dropdown
Props
| Prop | Type | Default | Description |
|---|
| label* | string | - | Label text for the menu item |
| href* | string | - | URL to navigate to when clicked |
| image | string | - | Optional image URL to display as preview when hovering or when active |
| className | string | "" | Custom class names for styling |
DockLink
Link button component for the dock
Props
| Prop | Type | Default | Description |
|---|
| label* | string | - | Label text for the link |
| href* | string | - | URL to navigate to when clicked |
| icon | React.ReactNode | - | Optional icon to display next to the label |
| external | boolean | false | Whether the link opens in a new tab |
| className | string | "" | Custom class names for styling |