Dock
A macOS-style icon dock that magnifies items as the pointer nears.
Import
tsx
import { Dock } from "@cronus-ui/ui";
bash
npx cronus-ui add dock
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component DockDefault layout:inline style:dock {
aria-label:"App dock"
label "App dock"
text "Home"
text "Search"
}
page "/audit/dock/default" type:custom {
use DockDefault
}
API Reference
Generated from the component's exported types.
DockProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
items* | DockItem[] | — | The dock entries, left to right. |
magnification | number | DEFAULT_MAGNIFICATION | Peak scale an item reaches at the pointer's center. Defaults to `1.6`. |
baseItemSize | number | DEFAULT_BASE_ITEM_SIZE | Resting item size in pixels. Defaults to `44`. |
distance | number | DEFAULT_DISTANCE | Pointer influence radius in pixels — how far the magnify reaches. Defaults to `120`. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |