Introduction
Components
- Accordion
- Action Sheet
- Alert
- Audio Player
- Audio Recorder
- Audio Waveform
- Avatar
- Badge
- BottomSheet
- Button
- Camera
- Camera Preview
- Card
- Carousel
- Checkbox
- Collapsible
- Color Picker
- Combobox
- Date Picker
- File Picker
- Gallery
- Hello Wave
- Icon
- Image
- Input
- Input OTP
- Link
- MediaPicker
- Mode Toggle
- Onboarding
- ParallaxScrollView
- Picker
- Popover
- Progress
- Radio
- ScrollView
- SearchBar
- Separator
- Share
- Sheet
- Skeleton
- Spinner
- Switch
- Table
- Tabs
- Text
- Toast
- Toggle
- Video
- View
Charts
import { HelloWave } from '@/components/ui/hello-wave';
import React from 'react';
export function HellowWaveDemo() {
return <HelloWave>π</HelloWave>;
}
Installation
pnpm dlx bna-ui add hello-wave
Usage
import { HelloWave } from '@/components/ui/hello-wave';
<HelloWave />
<HelloWave size='lg' />
<HelloWave size='sm'>πββοΈ</HelloWave>
Examples
Default
import { HelloWave } from '@/components/ui/hello-wave';
import React from 'react';
export function HellowWaveDemo() {
return <HelloWave>π</HelloWave>;
}
API Reference
HelloWave
An animated component that displays a waving hand emoji with rotation animation and customizable sizes.
Prop | Type | Default | Description |
---|---|---|---|
size | 'sm' | 'md' | 'lg' | 'md' | Controls the size of the emoji and animation scale. |
children | React.ReactNode | 'π' | Content to animate - typically an emoji string. |
Size Variants
The component includes three predefined size variants:
Size | Font Size | Line Height | Use Case |
---|---|---|---|
sm | 20px | 24px | Inline text, compact spaces |
md | 28px | 32px | Default size, most contexts |
lg | 36px | 40px | Headers, prominent display |
Animation Details
- Duration: 150ms for each rotation phase
- Rotation Range: 0Β° to 25Β° and back to 0Β°
- Repetitions: 4 complete wave cycles
- Timing: Runs automatically on component mount
- Easing: Uses default timing function for smooth animation
Customization
Custom Content
You can pass any content as children, not just the default wave emoji:
<HelloWave>πββοΈ</HelloWave>
<HelloWave>β¨</HelloWave>
<HelloWave size="lg">π</HelloWave>
Custom Components
For more complex customization, you can pass React components:
<HelloWave>
<CustomIcon name='wave' />
</HelloWave>
Styling
The component uses a centered container layout. For additional styling, wrap the component:
<View style={{ margin: 16 }}>
<HelloWave size='lg' />
</View>
Technical Notes
- Uses
react-native-reanimated
for smooth 60fps animations - Animation runs on the UI thread for better performance
- Automatically starts animation when component mounts
- Uses
useSharedValue
anduseAnimatedStyle
for optimal performance - Size variants include margin adjustments for proper vertical alignment
- Supports both string content and React components as children
Accessibility
The HelloWave component:
- Uses semantic emoji that screen readers can interpret
- Maintains proper text sizing for accessibility
- Works with system accessibility settings
- Animation doesn't interfere with screen reader functionality
- Proper font sizing scales with system text size preferences