Skip to content
VenusUI
Get started

Sparkles

Small stars that twinkle around a word, badge or button.

Preview

Installation

npx shadcn@latest add @venusui/sparkles

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/sparkles.tsx

Usage

The code behind the preview above.

sparkles-demo.tsx

import { Sparkles } from "@/components/ui/sparkles"

export default function SparklesDemo() {
  return (
    <h2 className="text-4xl font-semibold tracking-tight">
      Make it <Sparkles className="text-amber-400">sparkle</Sparkles>
    </h2>
  )
}

API reference

PropTypeDefaultDescription
countnumber10Number of sparkles.
colorstringtext colorSparkle color.

All <span> props, including className and children.

Requirements

  • Tailwind CSS v4. The CLI adds the sparkle keyframes. Works in Server Components.

Customization

  • Positions are pseudo-random but fixed, so server and browser HTML match.
  • Use one sparkling word per headline.

Accessibility

  • Sparkles are aria-hidden; the wrapped text is read normally.
  • Hidden with reduced motion.

Troubleshooting

Sparkles are clipped.
They extend 12px outside the text. Avoid overflow-hidden on the direct parent.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A tilted wall of vertically scrolling columns, for screenshots and showcases.

Loading preview

Background Beams

Backgrounds

Curved lines across a section with light traveling along them.

Loading preview

Beam Rain

Backgrounds

Beams of light fall to the floor and burst into sparks when they land.