Installation
This component requires CSS keyframes to be added to your global styles. The installation command will handle this automatically.
Usage
Examples
Basic Example
Simple shiny text with default settings.Custom Shimmer Width
Adjust the width of the shimmer effect.With Custom Styling
Combine with typography classes for different effects.In a Call-to-Action
Use in buttons or badges to draw attention.With Dark Mode
The component automatically adjusts colors for dark mode.Props
The text content to display with the shiny animation.
The width of the shimmer effect in pixels. This controls how wide the shining highlight appears.
Additional CSS classes to apply to the component.
CSS Animation
The component uses a CSS keyframe animation that is automatically added during installation:How It Works
The shimmer effect is created using:- A linear gradient with transparent edges and a bright center
background-clip: textto clip the gradient to the text shapetext-transparentto make the text color transparent- Animated background position to create the moving shimmer
Customization
Custom Animation Speed
Override the animation duration for faster or slower shimmer:Custom Colors
Modify the gradient colors using Tailwind utilities:Pause Animation on Hover
Freeze the animation when hovering:Single Pass Animation
Make the shimmer run only once:Use Cases
- Hero sections: Draw attention to key headlines
- Call-to-action buttons: Make CTAs more engaging
- Feature highlights: Emphasize important features
- Loading states: Indicate content that’s being processed
- Notifications: Draw attention to new or important messages
The default text color is muted to allow the shimmer effect to be more visible. Adjust the base color using the
class prop for different visual effects.