Components / Text
Shiny Text
A beam of light sweeps across the text on a loop. Great for badges and announcements.
Introducing HaierUI 2.0
✨ New components every week
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
$ npm install motion - 2
Add the component
Copy the code from the Code tab above into
components/ui/shiny-text.tsx. - 3
Use it
example.tsximport { ShinyText } from "@/components/ui/shiny-text"; export default function ShinyTextDemo() { return ( <div className="space-y-3 text-center"> <ShinyText text="Introducing HaierUI 2.0" className="text-3xl font-semibold tracking-tight" /> <p> <ShinyText text="✨ New components every week" className="text-sm" duration={3} /> </p> </div> ); }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | — | The text. |
| baseColor | string | "#71717a" | Resting text color. |
| shineColor | string | "#ffffff" | Color of the sweep. |
| duration | number | 2.5 | Seconds per sweep. |