BNA

BNA UI
22

Hello Wave

An animated waving hand emoji component with smooth rotation animation and customizable sizes.

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

API Reference

HelloWave

An animated component that displays a waving hand emoji with rotation animation and customizable sizes.

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Controls the size of the emoji and animation scale.
childrenReact.ReactNode'πŸ‘‹'Content to animate - typically an emoji string.

Size Variants

The component includes three predefined size variants:

SizeFont SizeLine HeightUse Case
sm20px24pxInline text, compact spaces
md28px32pxDefault size, most contexts
lg36px40pxHeaders, 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 and useAnimatedStyle 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