Sparkle Text
A word that catches the light: four-point stars bloom and fade around it on staggered clocks while the letters carry a soft ink-to-accent gradient. Sparkles on scroll-in or hover, then rests.
Try it: Hover the word to make it sparkle again.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/sparkle-text.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/sparkle-text. You can also copy the source into components/ui/sparkle-text.tsx (view on GitHub).
Usage
import { SparkleText } from '@/components/ui/sparkle-text'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
text | string | 'Delightful' | The text. |
as | 'h1' | 'h2' | 'h3' | 'p' | 'span' | 'span' | Element to render. |
colors | string[] | ['#8b74b5', '#f97316', '#c4b5fd'] | Sparkle colours (cycled). |
count | number | 10 | Max sparkles alive at once (1–20). |
restAfter | number | 6000 | ms of sparkling before resting; 0 never rests. |
gradient | boolean | true | Ink-to-accent gradient fill (AA in both themes). |
className | string | — | Extra classes merged onto the root. |
Dependencies
motion
Related Text Animations components
- Ink Bleed Text
A serif headline that soaks into the page: each word lands as a wet blot of ink that spreads through the paper fibres (an SVG turbulence displacement relaxing to zero), then dries crisp from a soft…
- Highlight Marker Text
Editorial copy annotated by hand: as it scrolls into view a marker sweeps behind one phrase, an underline draws under the next, a pen circle loops another and a strike crosses one out, in sequence.…
- Tumble Letters
A headline of physical letters: drop them and they fall, spin, bounce and pile against each other on the floor; hover lifts letters in a wave, any letter can be grabbed and flung, and Reassemble…
- Word Cycle Text
A headline whose key word keeps changing its mind: each word rises letter by letter out of a soft blur inside a tinted capsule that resizes on a spring while the line glides to make room.
- Glyph Weather
Glyphs drift with scroll direction.
- Charm Text
A sentence with a few enchanted words. Hover, focus or tap one and it recolours, draws an underline and a tiny glyph pops out on a spring; click pins it on. A chip variant sets glyph pills inline…