# Floating Action Button — React Native component for Expo

> A floating action button that fans out a staggered speed dial as its plus turns to ×.

Corner FAB in a solid accent fill with a matching glow. Tapping it fans out a staggered speed dial — a labelled list or an arc — over a dimmed backdrop while the button turns neutral and the plus rotates into ×. Extended mode springs between a pill and a circle; an optional pulse ring draws the eye on empty states.

- Docs: https://expokit.in/docs/components/fab
- Tier: Pro (ExpoKit Pro plan)
- Also called: floating button, speed dial, floating action menu, FAB
- Category: Buttons
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg, expo-haptics
- Uses ExpoKit items: kit
- Variants: Speed Dial, Arc, Extended Collapse, Variants, Custom Colours, Bottom Center, Empty State, Bottom Left List

## Installation

This component is part of ExpoKit Pro. With a Pro plan, log the CLI in once and add it like any other item:

```bash
npx @expokit/cli@latest login
```

Plans: https://expokit.in/pricing

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `actions` | `{ label, icon, onPress?, color? }[]` | — | Speed-dial items, bottom → top (arc: first → last). icon can be a node or ({ color }) => node; with color the icon colour contrasts automatically. Omit for a plain FAB. |
| `onPress` | `() => void` | — | Called when there are no actions. |
| `icon` | `ReactNode \| ({ color }) => ReactNode` | `plus` | Main icon (rotates 135° when open). A function is re-coloured as the button turns neutral when open. |
| `label` | `string` | — | Makes it an extended FAB (icon + label). |
| `extended` | `boolean` | `true` | Set false (e.g. while scrolling) to collapse the label into a circle. |
| `open / onOpenChange` | `boolean` | — | Controlled speed dial (or use defaultOpen). |
| `defaultOpen` | `boolean` | `false` | Speed dial starts open when uncontrolled. |
| `layout` | `"list" \| "arc"` | `"list"` | Labelled column, or mini buttons fanned out on a quarter circle (half circle for bottom-center). Arc hides the chips; labels stay as accessibility labels. |
| `position` | `"bottom-right" \| "bottom-left" \| "bottom-center"` | `"bottom-right"` | Corner of the parent it sits in. |
| `variant` | `"accent" \| "gradient" \| "tonal" \| "primary" \| "secondary"` | `"accent"` | accent: solid fill + same-colour glow; gradient: opt-in two-tone; tonal: soft tinted surface; primary / secondary: theme surfaces. |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Main button 40, 56 or 64pt (speed-dial buttons 36 / 42 / 46pt). |
| `color` | `string` | `theme accent` | Tint for accent, gradient and tonal; glow, foreground (and the opt-in gradient stops) are derived from it. |
| `backdrop` | `boolean` | `true` | Dim the parent while open; tap to close. |
| `pulse` | `boolean` | `false` | Looping attention ring (skipped with Reduce Motion), e.g. for empty-state calls to action. |
| `offset` | `number` | `20` | Distance from the parent's edges. |
| `rotate` | `boolean` | `true` | Rotate the icon into × when open. |
| `haptics` | `boolean` | `true` | Tap on toggle. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the absolutely positioned stack holding the main button and list actions. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: Tapping the button opens the speed dial over an optional dimmed backdrop; tapping the backdrop closes it. Without actions it just calls onPress.
- **Motion**: Actions spring out one after another as a labelled list or an arc. An extended FAB springs between a pill and a circle, and pulse loops a ring around it.
- **Reduced motion**: The pulse ring stays off when reduce motion is on.
- **Haptics**: A light impact when the button opens or closes the dial, or fires onPress.
- **Screen readers**: The main button and each action are buttons; the main button reads "Open actions" / "Close actions" with an expanded state when it has a dial.

## FAQ

### How do I make a floating button in React Native?

Use ExpoKit's Floating Action Button, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made floating button into your Expo or React Native app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Floating Action Button work in Expo Go?

Yes. Floating Action Button runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg, expo-haptics) are all included in Expo Go.

### How do I add Floating Action Button to my Expo app?

With ExpoKit Pro, add it with the ExpoKit CLI: it copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change. The install command is on this page for Pro members.

### Is Floating Action Button free?

Floating Action Button is part of ExpoKit Pro. With a Pro plan, log the CLI in once and it installs the full source into your app.

### Can I change how Floating Action Button looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/fab
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
