Getting Started
Components
- Animated Beam
- Animated Circular Progress Bar
- Animated Gradient Text
- Animated Grid Pattern
- Animated List
- Animated Shiny Text
- Animated Theme Toggler
- Aurora Text
- Backlight New
- Avatar Circles
- Bento Grid
- Blur Fade
- Border Beam
- Cool Mode
- Dia Text Reveal New
- Dither Shader New
- Dock
- Dot Pattern
- Dotted Map New
- File Tree
- Flickering Grid
- Grid Pattern
- Hero Video Dialog
- Hyper Text
- Icon Cloud
- Interactive Hover Button
- Lens
- Light Rays
- Line Shadow Text
- Magic Card
- Marquee
- Meteors
- Morphing Text New
- Motion Grid Beta
- Neon Gradient Card
- Number Ticker
- Orbiting Circles
- Pixel Image New
- Pointer
- Progressive Blur
- Pulsating Button
- Rainbow Button
- Retro Grid
- Ripple
- Ripple Button
- Scroll Progress
- Shimmer Button
- Shine Border
- Smooth Cursor
- Striped Pattern New
- Text Animate
- Typing Animation
- Video Text
- Warp Background
- Word Rotate Beta
Dock
A macOS-style dock component with smooth magnification animation on hover, inspired by the macOS dock.
motion-sv
Dock
Installation
pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/dock.json
Install dependencies
Install the required packages for this component:
pnpm add motion-sv
Copy the Source Code
Copy and paste the following code into your project:
dock.svelte
dock-icon.svelte
index.ts
Folder Structure
Folder Structure
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.
| Name | Type | Default | Description |
|---|---|---|---|
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.
| Name | Type | Default | Description |
|---|---|---|---|
class | string | "" | Additional CSS classes to apply. |
children | Snippet | - | The icon content to render inside the dock icon. |