Components / Magnifying Dock
Magnifying Dock
A dock whose items swell as the pointer nears, on springs. Distance drives the scale, so the whole row breathes rather than one icon popping.
Model
m·ẍ = −k·(x − size(d)) − c·ẋsize(d) the target size at pointer distance d · m 0.1 · k 200 · c 15
Props
| Property | Type | Default | Description |
|---|---|---|---|
items | DockItem[] | DOCK_ITEMS | Defaults to the five-icon row the demos show. |
activeId | string | null | — | Controlled selection. Pass null for none. |
defaultActiveId | string | null | null | Starting selection when uncontrolled. |
onSelect | (id: string | null, item: DockItem | null, index: number) => void | — | Fires on every activation, including deselection, where id is null. |
baseSize | number | 36 | Item size at rest, in px. |
magnifiedSize | number | 54 | Item size directly under the pointer, in px. |
surface | string | '#08101e' | Fill of the dock bar, of each item, and of the label that appears above one. |
border | string | '#142544' | Outline of the dock bar and of those labels. |
itemBorder | string | '#0c1f43' | Outline of an item at rest. |
accent | string | '#639aff' | Outline of the selected item, the keyboard focus ring, and the soft glow under the bar. |
icon | string | '#ffffff' | Colour of the icons and of the label text. |