Sparkles Text
- Source
- Magic UI ↗
- Author
- Magic UI
- Licence
- MIT
Loading…
Four-point sparkles twinkle in and out around a word.
Code
"use client";
import { SparklesText } from "@/lab/magicui/ui/sparkles-text";
export default function SparklesTextDemo() {
return (
<div className="@container relative flex h-full w-full items-center justify-center text-neutral-950">
<SparklesText className="text-[clamp(2.5rem,9cqw,3.75rem)]">Magic UI</SparklesText>
</div>
);
}
Prompt
Build "Sparkles Text", a text animation. What it does: Four-point sparkles twinkle in and out around a word. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion. Technique: the Motion library. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://magicui.design/docs/components/sparkles-text (Magic UI, MIT).