Expo App UIExpo App UI
Components

Toast

Lightweight notification that appears from the top or bottom and auto-dismisses.

Installation

npx expo-app-ui add toast

Usage

import Toast from "@/components/ui/toast";
import { useState } from "react";

const [show, setShow] = useState(false);

<Toast
  visible={show}
  onHide={() => setShow(false)}
  message="Saved successfully"
  variant="success"
  position="top"
  duration={3000}
/>

Props

PropTypeDefaultDescription
visiblebooleanrequiredShow/hide
messagestringrequiredToast text
variant'info' | 'success' | 'warning' | 'error''info'Color tone
position'top' | 'bottom''top'Anchor edge
durationnumber3000Auto-dismiss ms (0 = sticky)
onHide() => void-Called when fade-out completes
onPress() => void-Optional press handler
iconReactNode-Optional leading icon
topOffsetnumber56Top inset
bottomOffsetnumber56Bottom inset

Accessibility

  • accessibilityRole="alert" with accessibilityLiveRegion="polite" so VoiceOver/TalkBack announces it

On this page

Find this useful?

Buy me a coffee