Magnetic Dock
Use Magnetic Dock for a compact floating app launcher. Nearby items grow toward the pointer so people can scan and target actions without losing the dock's calm, stable structure.
Preview
Home
Installation
Basic usage
Usage
API
| Property | Type | Default | Description |
|---|---|---|---|
items | MagneticDockItem[] | required | App-launcher items rendered in the dock. |
magnification | number | 1.65 | The maximum item scale nearest the pointer. |
distance | number | 140 | The pointer distance in pixels that influences nearby items. |
itemSize | number | 48 | The base item size in pixels. |
className | string | — | Additional CSS classes for the dock surface. |
Accessibility
The dock is a labelled navigation landmark. Each item exposes its label to assistive technology, remains keyboard-focusable, and shows a visible label on focus. Reduced-motion preferences keep the dock fully functional while removing magnification movement.
Use href for navigation or onClick for an action button. Disabled items do not magnify. Touch input keeps the dock at its base size. Caller pointer handlers are composed with the magnetic behavior, and pointer cancellation resets the magnification.
Styling
CLI installation registers the shadow utilities automatically. For manual installation, install shadow-plugin and add @plugin "shadow-plugin"; to your Tailwind v4 stylesheet.
Place the dock in a fixed or sticky bottom container in your application. Use className to adapt its material, spacing, or placement without changing the magnetic targeting behavior.
Was this page helpful?
Your response helps us improve component docs.