structyl

Snackbar API

View component

The full prop reference for the Snackbar component. A brief status message.

Import

tsx
import { Snackbar } from '@structyl/styled';

Props

Snackbar

Floating status message.

PropTypeDefault
open | defaultOpen#boolean

Controlled or uncontrolled open state.

onOpenChange#(open: boolean) => void

Open state callback.

anchorOrigin#{ vertical: 'top' | 'bottom'; horizontal: 'left' | 'center' | 'right' }

Screen placement.

{ vertical: 'bottom', horizontal: 'left' }
message | action#React.ReactNode

Message and action slots.

autoHideDuration#number

Auto-dismiss delay.

onClose#(event, reason: 'timeout' | 'clickaway' | 'escapeKeyDown') => void

Close request callback.

className#string

Additional Tailwind classes merged with the component defaults.

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library