Expo App UIExpo App UI
Components

Snackbar

Bottom-anchored notification with an optional action button. Material Design style.

Installation

npx expo-app-ui add snackbar

Usage

import Snackbar from "@/components/ui/snackbar";

<Snackbar
  visible={show}
  message="Item moved to trash"
  action={{ label: "Undo", onPress: handleUndo }}
  onDismiss={() => setShow(false)}
/>

Props

PropTypeDefaultDescription
visiblebooleanrequiredShow/hide
messagestringrequiredSnackbar text
action{ label, onPress }-Optional action button
durationnumber4000Auto-dismiss ms (0 sticky)
onDismiss() => void-Called after fade-out
backgroundColorstring'#1F2937'Bar background
textColorstring'#FFFFFF'Message color
actionColorstring'#60A5FA'Action label color
bottomOffsetnumber24Bottom inset

Accessibility

  • accessibilityRole="alert" with accessibilityLiveRegion="polite"
  • Action button is a focusable Pressable with accessibilityRole="button"

On this page

Find this useful?

Buy me a coffee