Installation
Usage
Examples
Full Dock with Icons
Without Magnification
Custom Size and Distance
Component API
Dock
Child DockIcon components.
Base size of icons in pixels.
Size of icons when magnified (on hover) in pixels.
Whether to disable the magnification effect. When true, icons maintain their base size and show a background color change on hover instead.
Distance from the icon center where magnification starts to take effect, in pixels.
Vertical alignment of icons within the dock.
top: Items aligned to the topmiddle: Items centered (default)bottom: Items aligned to the bottom
Additional CSS classes to apply to the dock container.
DockIcon
Icon content to display.
Additional CSS classes to apply to the icon container.
Features
- macOS-style magnification effect with smooth spring physics
- Mouse-distance-based scaling with linear interpolation
- Configurable icon sizes and magnification strength
- Adjustable activation distance
- Backdrop blur effect for modern appearance
- RTL support
- Disabled magnification mode with hover background
- Spring animations with configurable mass, stiffness, and damping
- Uses MotionValue for high-performance reactive transforms
Animation Details
The magnification effect uses:- Spring physics:
mass: 0.1, stiffness: 150, damping: 12 - Distance calculation: Transforms mouse X position to distance from icon center
- Size interpolation: Linear interpolation based on distance, clamped to
iconDistancerange - Smooth transitions: useSpring applies spring physics to the size transform
Context Architecture
The Dock component provides context to child DockIcon components:Dependencies
- motion-sv