Text Animations
Reflection Text
A stylish mirrored reflection text component for hero sections or branding.
Overview
The Reflection component displays mirrored text with customizable styles, making it perfect for hero sections, branding headers, or interactive UI elements.
Key features include:
- Reflected Text: Displays a mirrored version of your text with adjustable opacity.
- Customizable Size and Color: Easily modify font size and color with props.
- Extendable Styles: Apply more styles using the
additionalStylesprop.
ChaiUI
ChaiUI
CLI Installation
If you’re using ChaiUI's registry system, install via:
Manual Installation
To manually set up the Reflection component in your project, follow these steps:
- Go to your
srcdirectory. - Create a folder structure:
components/ui/reflection. - Inside the
reflectionfolder, create a file namedreflection.tsx. - Paste the following code into
reflection.tsx.
Usage
Import and use the Reflection component like this:
Props
| Prop | Type | Description | Default |
|---|---|---|---|
text | string | The main text to display and reflect | –(required)` |
fontSize | string | Tailwind font size class (e.g., 6xl, 4xl) | "6xl" |
textColor | string | Tailwind text color (e.g., white, gray-600) | "white" |
reflectionOpacity | number | Tailwind opacity value (10-100) for reflected text | "30" |
additionalStyles | string | Extra classes to apply to the container | "" |