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';
Components
Type: React.Element<SnackbarProps>
Styling configuration for the snackbar shown by SnackbarHost. Pass as a
child to override colors or place the action on a new line.
boolean • Default: falseWhether the action should be placed on a new line below the message. Useful for long action labels.
ColorValueThe preferred content color used for the message text.
ColorValueThe content color used for the dismiss-action icon button.
Type: React.Element<SnackbarHostProps>
A Material 3 SnackbarHost
that displays snackbars triggered via its ref's showSnackbar method.
React.ReactNodeOptional Snackbar child supplying styling for shown snackbars. Mirrors
Compose's SnackbarHost(hostState) { data -> Snackbar(data, ...) } lambda.
Types
Literal type: string
How long the snackbar is shown. Mirrors Compose's SnackbarDuration enum.
Acceptable values are: 'short' | 'long' | 'indefinite'
Literal type: string
Reason a snackbar invocation resolved. Mirrors Compose's SnackbarResult enum.
Acceptable values are: 'actionPerformed' | 'dismissed'