Dock

Also called macOS dock, magnification dock, or app dock

A row of app icons, like the macOS dock, where icons near the pointer grow smoothly, a label appears on hover, and a dot marks open apps.

What is Dock?

A dock is a bar of app icons borrowed from the macOS desktop. As the pointer moves along it, the icon underneath grows the most and its neighbors grow a little less, so a wave of magnification follows the cursor. The app’s name appears in a small label above the icon, and a dot under an icon means that app is open.

To build one, track the pointer’s x position in a motion value, measure each icon’s distance from it, and map that distance to a size: largest at 0, back to normal about 140px away. Run the size through a spring so it eases instead of snapping, and grow width and height rather than scale, so the neighbors slide aside instead of overlapping.

On the web, a dock works as a playful launcher in a portfolio, a landing page hero, or a desktop-style app. For ordinary site navigation, a plain nav bar is clearer. Give every icon an accessible name and show its label on keyboard focus too, because a row of pictures is hard to tell apart. Touch screens have no hover, so the icons must work as plain buttons, and under reduced motion keep them at their normal size.

Often confused with

Magnetic button
A magnetic button shifts toward the pointer. Dock icons stay in their row and grow based on how close the pointer is.
All terms

Hover effect

A visual change, such as a lift, glow, or zoom, that happens when the mouse pointer moves over an element to show it can be clicked.

Spring animation

An animation driven by simulated spring physics in place of a fixed duration and curve, so motion can overshoot, settle, and react naturally.

Tooltip

A small label that appears next to an element when you hover over it or focus it, naming an icon button or adding a short hint.

Magnetic button

A button that leans toward the mouse pointer as it gets close, then springs back when the pointer leaves.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.