MindeesUI
ComponentsOverlays

Snackbar

A bottom-anchored transient message with one optional action that persists by default until dismissed or auto-hidden.

Snackbar shows a short, low-priority message anchored to the bottom of the screen, with one optional trailing action such as Undo. Unlike Toast, it persists by default — set a positive duration to auto-hide. It fades in respecting reduce motion and announces itself politely to assistive tech.

Import

import { Snackbar } from '@mindees/ui';

Usage

const [visible, setVisible] = useState(false);

return (
  <Snackbar
    visible={visible}
    message="Message archived"
    action={{ label: 'Undo', onPress: restore }}
    onDismiss={() => setVisible(false)}
  />
);

Props

PropTypeDefaultDescription
visiblebooleanControls whether the snackbar is shown.
messagestringText content announced and displayed.
actionSnackbarActionOptional single trailing action ({ label, onPress }).
onDismiss() => voidCalled when the auto-dismiss timer elapses.
durationnumber0Auto-dismiss after N ms. 0 keeps it open until hidden.
styleStyleProp<ViewStyle>Style applied to the snackbar surface.

Accessibility

The surface uses accessibilityRole="alert" with a polite live region, and the message is announced through the library announcer when it appears. The trailing action is a Pressable with accessibilityRole="button" labeled by its text and a 44pt minimum tap target. The fade animation is skipped when reduce motion is enabled.

On this page