# Toast — React Native component for Expo

> Sonner-style toasts whose tone icon draws itself while a hairline drains away.

Sonner-style toasts with living tone icons: the outline draws itself inside a halo, a light-leak glow spills behind it, and a hairline drains along the bottom as time runs out (paused while touched). toast.promise() closes the spinning arc into the success or error circle before the mark draws in, variant="minimal" gives compact inverted pills (with a second line for the description), and variant="island" turns the Toaster into an iPhone-style Dynamic Island.

- Docs: https://expokit.in/docs/components/toast
- Tier: Free
- Also called: toast message, snackbar, in-app notification
- Category: Feedback
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg, expo-haptics, react-native-gesture-handler, react-native-reanimated, react-native-worklets
- Uses ExpoKit items: kit
- Variants: Default, Rich Colors, Island, Promise Morph, Minimal, With Action, Expanded, With Provider

## Installation

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

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

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

Import: `import { Toaster } from "@/components/ui/toast";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `toast(title, options?)` | `(string, ToastOptions) => id` | — | Global API. Also toast.success / error / warning / info / loading / promise / dismiss(id?). |
| `ToastProvider / useToast()` | `context` | — | Scoped store: wrap UI + <Toaster />, call useToast() instead of the global toast(). |
| `options.description` | `string` | — | Second line. |
| `options.action` | `{ label, onPress }` | — | Inline button (dismisses after press). |
| `options.icon` | `ReactNode \| false` | `type icon` | Replace the type icon, or false for none. |
| `options.duration` | `number` | `Toaster duration` | ms before auto-dismiss; Infinity to keep. |
| `options.id` | `string` | `auto` | Reuse to update a toast in place. |
| `options.toaster` | `string` | — | Target a <Toaster id>. |
| `<Toaster> position` | `"top" \| "bottom"` | `"bottom"` | Edge the stack sits on (island always sits top-centre). |
| `<Toaster> variant` | `"default" \| "rich" \| "minimal" \| "island"` | `"default"` | Cards with a tone glow, cards filled with the solid tone, compact inverted pills, or a black Dynamic Island capsule that springs open, morphs between toasts (tap to expand, swipe up to dismiss). |
| `<Toaster> duration` | `number` | `4000` | Default auto-dismiss in ms. |
| `<Toaster> visibleToasts` | `number` | `3` | Cards visible in the stack. |
| `<Toaster> expand` | `boolean` | `false` | Always fanned out. |
| `<Toaster> offset / gap` | `number` | `16 (island 10) / 10` | Edge distance and fan-out spacing. Added on top of safeArea and bottomInset. |
| `<Toaster> safeArea` | `boolean` | `false` | Clear the notch / Dynamic Island and home indicator using react-native-safe-area-context's insets (when installed; every Expo Router app has it). |
| `<Toaster> bottomInset` | `number` | `0` | Extra space under a bottom stack for a tab bar or composer: <Toaster safeArea bottomInset={49} /> in your (tabs) layout. |
| `<Toaster> closeButton` | `boolean` | `false` | ✕ on every toast. |
| `<Toaster> id` | `string` | — | Only show toasts sent with { toaster: id }. |
| `<Toaster> haptics` | `boolean` | `true` | Success / warning / error notification haptic when a toast appears or resolves. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the <Toaster> host that fills the screen and positions the stack. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: Tap the stack to fan it out, swipe a toast sideways or toward the edge to dismiss it; timers and the drain line pause while you touch.
- **Motion**: Tone icons draw their outline inside a halo; toast.promise() closes the spinning arc into the success or error mark. variant="island" morphs like a Dynamic Island.
- **Reduced motion**: Tone icons appear fully drawn without the spin or pop, and the island skips its squash and staggered morph.
- **Haptics**: A success, warning or error notification when a toast of that type appears, landing as the loading circle closes; turn it off with haptics={false}.
- **Screen readers**: Each toast is an alert in a polite live region, labelled by its title and description, with action and Dismiss buttons.

## FAQ

### How do I make a toast message in React Native?

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

### Does Toast work in Expo Go?

Yes. Toast runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg, expo-haptics, react-native-gesture-handler, react-native-reanimated, react-native-worklets) are all included in Expo Go.

### How do I add Toast to my Expo app?

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

### Is Toast free?

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

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