Text Animations
Sliding Text
A smooth animated sliding text component with customizable gradient and speed for modern UIs.
Overview
The SlidingText component creates a continuously moving text with gradient styles, perfect for headers, hero sections, and attention-grabbing banners.
Key features include:
- Continuous Sliding Motion: Text moves infinitely from left to right.
- Custom Duration: Control how fast the text scrolls.
- Gradient Text: Use customizable gradient colors for vibrant visual effects.
CLI Installation
If you’re using ChaiUI's registry system, install via:
Manual Installation
To manually set up the SlidingText component in your project, follow these steps:
- Go to your
srcdirectory. - Create a folder structure:
components/ui/sliding. - Inside the
slidingTextfolder, create a file namedsliding.tsx. - Paste the following code into
sliding.tsx.
Usage
Import and use the SlidingText component like this:
Props
| Prop | Type | Description | Default |
|---|---|---|---|
text | string | The text to be displayed and animated | – (required) |
duration | string | Duration of the animation (e.g., "10s", "5s") | "10s" |
gradientFrom | string | Tailwind color name to start the gradient | "blue-500" |
gradientTo | string | Tailwind color name to end the gradient | "green-400" |