# FAB (Floating Action Button) Floating action button with spring animation and shadow. ## Features - ✅ Spring press animation - ✅ Customizable position (bottom/right/left) - ✅ Custom colors and icon - ✅ Shadow effect - ✅ Built with Reanimated ## Installation ```bash npx @memoro/ui add fab ``` **Dependencies:** `icon`, `react-native-reanimated` ## Usage ### Basic FAB ```tsx import { FAB } from '@/components/ui/FAB'; console.log('Pressed')} /> ``` ### Custom Colors ```tsx {}} /> ``` ### Custom Position ```tsx // Bottom right (default) {}} /> // Bottom left {}} /> // Higher position {}} /> ``` ### Larger Icon ```tsx {}} /> ``` ## Props | Prop | Type | Default | Description | |------|------|---------|-------------| | `icon` | `string` | - | **Required** - Icon name | | `onPress` | `() => void` | - | **Required** - Press handler | | `bottom` | `number` | `100` | Distance from bottom (px) | | `right` | `number` | `16` | Distance from right (px) | | `left` | `number` | - | Distance from left (overrides right) | | `backgroundColor` | `string` | `'#3B82F6'` | Button background color | | `iconColor` | `string` | `'#FFFFFF'` | Icon color | | `iconSize` | `number` | `24` | Icon size | | `style` | `ViewStyle` | - | Additional container styles | ## Default Styling - **Size:** 56x56px - **Border Radius:** 28px (perfect circle) - **Background:** Blue (#3B82F6) - **Icon:** White, 24px - **Shadow:** Colored shadow matching background ## Animation - Press scales down to 0.9 - Releases back to 1.0 - Spring animation with damping ## Examples ### Create/Add FAB ```tsx ``` ### Camera FAB ```tsx ``` ### Edit FAB ```tsx ``` ### Multiple FABs (Stacked) ```tsx <> ``` ## Position Tips - **Default:** `bottom={100}, right={16}` - **Above Tab Bar:** `bottom={80-100}` - **Below Tab Bar:** `bottom={20}` - **Multiple FABs:** Stack with 70px spacing ## Dependencies - `Icon` component - `react-native-reanimated` (v3+) ## Notes - Uses absolute positioning - ensure parent has appropriate layout - Z-index of 10 (appears above most content) - Shadow color matches background for glowing effect - Press animation is hardware accelerated (Reanimated) - Icon uses Icon component (SF Symbols on iOS, Ionicons elsewhere)