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

Reduce motion:Off
Tune:Off
Inspect

Home

Installation

Basic usage

TypeScript
app-dock.tsx

Usage

API

PropertyTypeDefaultDescription
itemsMagneticDockItem[]requiredApp-launcher items rendered in the dock.
magnificationnumber1.65The maximum item scale nearest the pointer.
distancenumber140The pointer distance in pixels that influences nearby items.
itemSizenumber48The base item size in pixels.
classNamestring—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.