Getting Started
Components
Special Effects
Animations
Text Animations
Backgrounds
A vertical rotation of words
motion-sv
Word
Installation
pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/word-rotate.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:
word-rotate.svelte
index.ts
Folder Structure
Folder Structure
Props
WordRotate
A component for Word Rotate.
| Name | Type | Default | Description |
|---|---|---|---|
class | string | "" | Additional CSS classes to apply |
words | string[] | required | Array of words to rotate through |
duration | number | 2500 | Duration between word changes in milliseconds |
motionProps | MotionProps | { initial: { opacity: 0, y: -50 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: 50 }, transition: { duration: 0.25, ease: 'easeOut' } } | Motion animation properties |