# HeaderButton Icon button component for header actions. ## Features - ✅ Icon-based button - ✅ Press feedback - ✅ Disabled state - ✅ Customizable size and color - ✅ Touch target optimization (hit slop) - ✅ Clean, minimal design ## Installation ```bash npx @memoro/ui add header-button ``` **Dependencies:** icon ## Usage ### Basic HeaderButton ```tsx import { HeaderButton } from '@/components/navigation/HeaderButton'; console.log('Search')} />; ``` ### Custom Size and Color ```tsx ``` ### Disabled State ```tsx ``` ### Multiple Buttons ```tsx ``` ## Props | Prop | Type | Default | Description | | ----------- | ------------ | ------------------------------------- | ---------------------------- | | `icon` | `string` | - | **Required** - Icon name | | `onPress` | `() => void` | - | **Required** - Press handler | | `size` | `number` | `24` | Icon size in pixels | | `iconColor` | `string` | `'#6B7280'` | Icon color | | `disabled` | `boolean` | `false` | Button is disabled | | `style` | `ViewStyle` | - | Additional styles | | `hitSlop` | `object` | `{top:10,bottom:10,left:10,right:10}` | Touch target expansion | ## Default Styling - **Icon Size:** 24px - **Icon Color:** Gray (#6B7280) - **Padding:** 8px - **Hit Slop:** 10px all sides - **Disabled Opacity:** 0.4 - **Pressed Opacity:** 0.7 ## Examples ### Save Button ```tsx ``` ### Close Button ```tsx ``` ### Add Button ```tsx ``` ### Share Button ```tsx ``` ### More Menu ```tsx ``` ### Edit Button ```tsx ``` ## Integration with Header ### Single Action ```tsx
router.back()} rightContent={} /> ``` ### Multiple Actions ```tsx
} /> ``` ### Conditional Actions ```tsx
router.back()} rightContent={ <> {isEditing && ( )} } /> ``` ## Common Use Cases ### Search ```tsx ``` ### Filter ```tsx ``` ### Sort ```tsx ``` ### Settings ```tsx ``` ### Notifications ```tsx {hasUnread && ( )} ``` ### Download ```tsx ``` ### Delete ```tsx ``` ### Favorite ```tsx ``` ## Styling Patterns ### With Margin ```tsx ``` ### Larger Touch Target ```tsx ``` ### Custom Padding ```tsx ``` ## Notes - Perfect for header actions - Hit slop ensures easy tapping - Works well with Icon component - Use consistent icon sizes across headers - Combine multiple buttons with gap/spacing - Consider disabled state for unavailable actions - Press feedback is automatic