React

Snackbar

A component that temporarily appears at the bottom of the screen to inform users of status or results.

Available since@seed-design/react@0.0.1, @seed-design/css@0.0.1

Installation

npx @seed-design/cli@latest add ui:snackbar

Props

Snackbar

Prop

Type

SnackbarAdapter.create Parameters (CreateSnackbarOptions)

Prop

Type

SnackbarProvider

Prop

Type

childrenReact.ReactNode

Examples

Variants

Positive

Critical

Pause on Interaction

To prevent Snackbar from being dismissed due to timeout while the user interacts with Snackbar (hover and active), set pauseOnInteraction to true on SnackbarProvider.

Default
  • Through @seed-design/react@0.1.14: false: If not explicitly set, timeout dismisses the Snackbar regardless of interaction.
  • Later versions: true: If not explicitly set, timeout pauses while the user interacts.

Strategy

When you create a new Snackbar while one is already displayed, by default it immediately replaces the existing Snackbar (immediate). To queue and show them sequentially, use strategy: "queued".

strategy can be set as a default in SnackbarProvider, or specified individually when calling create().

Avoid Overlap

You can specify an area where snackbars should not overlap using the <SnackbarAvoidOverlap /> component. Child components of <SnackbarAvoidOverlap /> must receive ref via forwardRef (React 18) or ref prop (React 19). The offset is updated in the following situations:

  • When a child component of SnackbarAvoidOverlap is mounted
  • When a child component of SnackbarAvoidOverlap is unmounted
  • When the height of a child component of SnackbarAvoidOverlap changes
  • When the height of SnackbarRegion changes

Table of contents