Command Palette
Search for a command to run

Dock

A macOS-style dock component with smooth magnification animation on hover, inspired by the macOS dock.

motion-sv

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/dock.json

Examples

Direction

Direction: Top
Direction: Middle (Default)
Direction: Bottom

Custom Magnification

Colored Icons

Disabled Magnification

Props

Dock

The main dock container that provides context and handles mouse tracking for magnification effects.

NameTypeDefaultDescription
class
string "" Additional CSS classes to apply.
iconSize
number 40 The base size of icons in pixels.
iconMagnification
number 60 The magnified size of icons when hovered.
disableMagnification
boolean false Disables the magnification effect on hover.
iconDistance
number 140 The distance in pixels at which magnification starts to take effect.
direction
"top" | "middle" | "bottom" "middle" The alignment direction of icons within the dock.
children
Snippet - The dock icon children to render inside the dock.

DockIcon

Individual icon wrapper that responds to the dock's magnification context.

NameTypeDefaultDescription
class
string "" Additional CSS classes to apply.
children
Snippet - The icon content to render inside the dock icon.