Command Palette
Search for a command to run

Letter Swap

A text component that swaps the letters vertically on hover.

motion-sv
Hover me chief! Awesome! Good day! More text? oh, seriously?!

There are two types of animations available for this component:

  1. Forward animation — plays the animation timeline once forward, when you hover over the text.
  2. Ping Pong animation — plays the animation timeline in a ping pong fashion. It plays once forward when you hover over the text, and once in the opposite direction when you hover away from the text.

Installation

Forward Animation

pnpm dlx shadcn-svelte@latest add http://sveltekit-prerender/f/letter-swap.json

Ping Pong Animation

pnpm dlx shadcn-svelte@latest add http://sveltekit-prerender/f/letter-swap-ping-pong.json
Visit Original Docs

For more deeper understaing visit fancy components documentation.

Examples

Stagger From

First Center Last

Line Swap

By setting the staggerDelay prop to zero, you can create a line swap effect.

oh, wow! nice!

Ping Pong

First Center Last