Morphiq

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

PropertyTypeDefaultDescription
itemsDockItem[]DOCK_ITEMSDefaults to the five-icon row the demos show.
activeIdstring | null—Controlled selection. Pass null for none.
defaultActiveIdstring | nullnullStarting selection when uncontrolled.
onSelect(id: string | null, item: DockItem | null, index: number) => void—Fires on every activation, including deselection, where id is null.
baseSizenumber36Item size at rest, in px.
magnifiedSizenumber54Item size directly under the pointer, in px.
surfacestring'#08101e'Fill of the dock bar, of each item, and of the label that appears above one.
borderstring'#142544'Outline of the dock bar and of those labels.
itemBorderstring'#0c1f43'Outline of an item at rest.
accentstring'#639aff'Outline of the selected item, the keyboard focus ring, and the soft glow under the bar.
iconstring'#ffffff'Colour of the icons and of the label text.