Installation
Usage
Props
This component uses a predefined set of greetings and does not accept props for customization.Features
- Rapid Cycling: Quickly transitions through multiple greetings
- Multi-Language: Shows greetings in 8 different languages
- Auto-Complete: Stops on the final greeting
- Smooth Transitions: Uses AnimatePresence for exit animations
- Visual Indicator: Includes a decorative dot next to each greeting
Default Greetings
The component cycles through:- Hello (English)
- こんにちは (Japanese)
- Bonjour (French)
- Hola (Spanish)
- 안녕하세요 (Korean)
- Ciao (Italian)
- Hallo (German)
- こんにちは (Japanese)
Animation Details
- Interval: 300ms between transitions
- Entrance: Slides up with fade in (y: 20 → 0)
- Exit: Slides up further and fades out (y: 0 → -100)
- Duration: 0.2s per transition
How It Works
- Component starts with first greeting
- Every 300ms, advances to next greeting
- Continues until reaching the final greeting
- Animation stops, displaying the last greeting
Styling
The component is styled for a clean, modern look:- Centered content with fixed dimensions
- Medium-weight font at text-2xl size
- Decorative dot indicator
- Adapts to light/dark mode
Use Cases
- Landing page hero sections
- Welcome messages
- Multilingual site introductions
- Loading or transition states
- Brand personality displays
Dependencies
motion/react- Animation library and AnimatePresencereact- Hooks (useState, useEffect)