This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Snackbar
A brief notification that appears at the bottom of the screen to provide feedback without interrupting the user.
Expo UI exposes two components that mirror Jetpack Compose's Snackbar APIs:
SnackbarHostwraps Compose's SnackbarHost and SnackbarHostState. Place it once in your layout, then callshowSnackbaron theref. Snackbars auto-dismiss based ondurationand can also be dismissed via the action button or the optional close icon.Snackbaris a styling-only child ofSnackbarHost. Pass one to override colors or place the action on a new line. Maps to thesnackbarlambda parameter ofSnackbarHost(hostState) { data -> Snackbar(data, ...) }in Compose.


Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Showing a snackbar
Place a SnackbarHost once in your layout and call showSnackbar on its ref to display a message. The returned promise resolves with 'actionPerformed' or 'dismissed' once the snackbar goes away.
Custom styling
Pass a Snackbar child to SnackbarHost to override colors or place the action on a new line. The Snackbar itself takes no content, the message and action come from each showSnackbar call.
API
import { Snackbar, SnackbarHost } from '@expo/ui/jetpack-compose';
No API data file found, sorry!