macOS JS behaviour

The Dock

The Dock with real magnification: icons grow by pointer distance and shove their neighbours, running dots under open apps, the middle separator and the trash at the end.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

The Dock

Sweep the pointer across the tray: each tile swells by its Gaussian distance from the pointer and pushes its neighbours aside. Two apps are running; click one to bounce it.

Important props

Important props
Prop Type Default What it does
magnification curve 'gaussian' Gaussian magnification around the pointer; neighbours share in.
running-dot marker '4px' A 4px dot under open apps.
tooltip label 'hover' The app name in a bubble after a short hover.

Snippet

<div class="mcdock" onpointermove="mcdockMagnify(event)">
    <img class="mcdock-icon" src="finder.png" data-name="Finder">
    <img class="mcdock-icon" src="mail.png" data-name="Mail">
    <span class="mcdock-sep"></span>
    <img class="mcdock-icon" src="trash.png" data-name="Trash">
</div>

<style>
.mcdock { display: flex; align-items: flex-end; gap: 8px; padding: 6px;
          border-radius: 20px; background: #ffffff59;
          backdrop-filter: blur(24px) saturate(1.6);
          box-shadow: inset 0 0 0 .5px #ffffffa6; }
.mcdock-icon { inline-size: 52px; transition: inline-size .12s ease-out; }
.mcdock-icon:hover { inline-size: 76px; }
</style>