Magic Text

Sparkles Text Component

A text component with animated sparkle effects to draw attention to important text elements.

  • Customizable sparkle colors and size
  • Configurable animation speed
  • Works with any text content
  • Adds visual interest to headings or important text

Installation

The Sparkles Text component is part of our UI library. You can import it directly from the components directory.


Usage

Here is how to use the Sparkles Text component in your project.

React TSX
1import { SparklesText } from "@/components/modern-ui/sparkles-text"

React TSX
1<SparklesText>Magic Text</SparklesText>

Examples

Default Sparkles Text

Magic Text

Colored Sparkles Text

Colorful Magic

Custom Sparkles Text

Special Offer

API Reference

Properties

PropertyTypeDefaultDescription
childrenReact.ReactNode-The text content to display with sparkles
textstring-Alternative to children prop for text content
sparkleCountnumber10Number of sparkles to display
sparklesCountnumber10Alias for sparkleCount
sparkleSizenumber15Size of sparkles in pixels
sparkleColorsstring[]-Array of custom sparkle colors
colors{ first: string, second: string }{ first: "#9E7AFF", second: "#FE8BBB" }Default pair of colors if sparkleColors not provided
speednumber0.3Animation speed for sparkles (0.1 to 1.0)
classNamestring-Additional CSS classes