# Button — React Native component for Expo

> A button that springs down on press, in eleven variants including gradient and glow.

Spring press feedback, eleven variants — including a two-tone gradient, a coloured glow and an elevated surface — four sizes, icons and a loading state. Pass any colour and every tinted variant follows it.

- Docs: https://expokit.in/docs/components/button
- Tier: Free
- Also called: custom button, animated button, pressable button
- 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: Variants, Gradient And Glow, Dynamic Color, Sizes, Loading, Colors

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add button
```

The CLI copies the source into your project (you own the code) and installs react-native-svg, expo-haptics.

Import: `import { Button } from "@/components/ui/button";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"primary" \| "accent" \| "secondary" \| "outline" \| "ghost" \| "soft" \| "destructive" \| "link" \| "gradient" \| "glow" \| "elevated"` | `"primary"` | Solid primary / accent / secondary / danger fill, bordered outline, transparent ghost, tinted soft, underlined link, two-tone gradient, accent with a coloured glow, or a raised elevated surface. |
| `size` | `"sm" \| "md" \| "lg" \| "icon"` | `"md"` | 36 / 46 / 54pt, or a round icon button. |
| `loading` | `boolean` | `false` | Spinner + blocks presses. |
| `left / right` | `ReactNode` | — | Icons beside the label. |
| `block` | `boolean` | `false` | Stretches to the parent's width (alignSelf: stretch). |
| `pill` | `boolean` | `false` | Fully rounded. |
| `color` | `string` | `theme accent` | Any colour; recolours every tinted variant and picks readable text automatically. |
| `gradientTo` | `string` | `color shifted 38° on the hue wheel` | Second stop for variant="gradient". |
| `haptics` | `boolean` | `false` | Light tap on press. |
| `textStyle` | `StyleProp<TextStyle>` | — | Style for the label text (merged over size and variant typography). |
| `style` | `StyleProp<ViewStyle>` | — | Style for the outer animated wrapper (margins, alignment); the pressable surface keeps its own. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |
| `…PressableProps` | `` | — | onPress, disabled, … |

## Behaviour & accessibility

- **Touch**: Scales down with a spring on press-in and bounces back on release. loading swaps the label for a spinner and blocks presses.
- **Haptics**: Opt-in light impact on press with haptics; off by default.
- **Screen readers**: A button with disabled and busy state.

## FAQ

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

Use ExpoKit's Button: run npx @expokit/cli@latest add button in your Expo or React Native project and it copies a ready-made custom button into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Button work in Expo Go?

Yes. 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 Button to my Expo app?

Run npx @expokit/cli@latest add button in your project. The CLI copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change.

### Is Button free?

Yes. Button is free: its full source is on this page and the CLI installs it without an account.

### Can I change how 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/button
- 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
