Skip to content

Magnifying Dock

Dock icons grow around the pointer with lifted labels and a soft glass base.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import MagnifyingDock from "./MagnifyingDock";
export default function Example() {
return (
<MagnifyingDock
items={[
{
"id": "library",
"label": "Library",
"icon": "▧",
"color": "#bdadcd"
},
{
"id": "canvas",
"label": "Canvas",
"icon": "✦",
"color": "#ddb58d"
},
{
"id": "palette",
"label": "Palette",
"icon": "◈",
"color": "#9db5bf"
},
{
"id": "notes",
"label": "Notes",
"icon": "≋",
"color": "#c5c19d"
}
]}
activeId={"canvas"}
size={52}
magnification={1.55}
background={"#27232dcc"}
label={"Creative workspace"}
/>
);
}

Using Magnifying Dock

Supply a compact set of labelled actions through items. activeId marks the current item and onSelect handles activation.

Adjust size and magnification together so enlarged icons fit the available width. Keep labels even when every item has an icon.

Props

NameTypeRequiredDefaultDescription
itemsobject[]No[]Array of { id, label, icon?, color?, disabled? }. Icons accept React nodes; missing icons use the first label character.
onSelectfunctionNoundefinedCalled with (item, index) when an item is activated.
activeIdstringNoundefinedOptional active item id, marked with aria-current and a dot.
sizenumberNo48Base icon size in pixels.
magnificationnumberNo1.55Focused or hovered icon scale; neighbours grow by a smaller amount.
backgroundstringNo"#27232dcc"Dock surface CSS colour, including alpha.
labelstringNo"Application dock"Accessible group label.
classNamestringNo""Additional classes merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing, typography, and appearance.

Related components

Pagination Rail

Navigation

A raised selection moves through a compact row of numbered page controls.

Layered chevron tabs create a compact trail with a distinct current page.

Folding Menu

Navigation

Numbered navigation panels unfold beneath a compact, tactile trigger.

Path Stepper

Navigation

Numbered stops connect into a clean vertical route with completed and current states.