Skip to main content

Snackbar

Imports

import {Snackbar} from 'material-expressive-react';
import {Snackbar} from 'material-expressive-react/snackbar';

Props

PropTypeDefaultRequiredDescription
actionstringNoOptional action button label.
When provided, an action button is rendered.
closeButtonbooleanfalseNoWhether to show the close (dismiss) icon button.
durationnumber4000NoHow long the snackbar stays visible (in ms) before auto‑dismissing.
Use SnackbarDuration.INDEFINITE to disable auto‑dismiss.
multiLinebooleanfalseNoWhen true, the snackbar uses a taller multi‑line layout
with action buttons aligned to the bottom‑end.
onAction(() => void)NoCallback fired when the action button is clicked.
onClose(() => void)NoCallback fired when the close button is clicked.
onDismiss(() => void)NoCallback fired when the snackbar is dismissed (by timeout, action, or close).
openbooleanfalseNoWhether the snackbar is visible.
Controls the mount/unmount lifecycle.
supportingTextstringYesThe supporting text displayed in the snackbar.

Events

This component does not explicitly re-emit DOM events via wrapper props.

Slots

Material Web components frequently use named slots. In React, you can pass slot="..." on children (e.g. <Icon slot="icon" />).

If you need to slot a child component that does not accept a slot prop, use the Slotted utility (see Utilities → Slotted).

Examples

See Storybook for live examples and variants.