Skip to content
Premium & Brand

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.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
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>

Skip DockProps props table
PropTypeDefaultDescription
items*
DockItem[]—The dock entries, left to right.
magnification
numberDEFAULT_MAGNIFICATIONPeak scale an item reaches at the pointer's center. Defaults to `1.6`.
baseItemSize
numberDEFAULT_BASE_ITEM_SIZEResting item size in pixels. Defaults to `44`.
distance
numberDEFAULT_DISTANCEPointer 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.