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
- Avatar Circles
- Bento Grid New
- Blur Fade
- Border Beam
- Cool Mode
- Dither Shader New
- Dock New
- Dot Pattern
- Dotted Map New
- File Tree
- Flickering Grid
- Grid Pattern
- Hero Video Dialog
- Hyper Text New
- Icon Cloud New
- Interactive Hover Button
- Lens New
- Light Rays New
- Line Shadow Text New
- Magic Card New
- Marquee
- Meteors New
- Morphing Text New
- Motion Grid New
- Neon Gradient Card New
- Number Ticker
- Orbiting Circles New
- Pixel Image New
- Pointer New
- Progressive Blur New
- Pulsating Button
- Rainbow Button
- Retro Grid New
- Ripple
- Ripple Button
- Scroll Progress
- Shimmer Button
- Shine Border New
- Smooth Cursor New
- 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. |