SnackbarUnstyled API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import SnackbarUnstyled from '@mui/base/SnackbarUnstyled';
// or
import { SnackbarUnstyled } from '@mui/base';Props
Props of the native component are also available.
| Name | Type | Default | Description | 
|---|---|---|---|
| autoHideDuration | number | null | The number of milliseconds to wait before automatically calling the  onClosefunction.onCloseshould then set the state of theopenprop to hide the Snackbar. This behavior is disabled by default with thenullvalue. | 
| component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
| disableWindowBlurListener | bool | false | If  true, theautoHideDurationtimer will expire even if the window is not focused. | 
| exited | bool | true | The prop used to handle exited transition and unmount the component. | 
| onClose | func | Callback fired when the component requests to be closed. Typically  onCloseis used to set state in the parent component, which is used to control theSnackbaropenprop. Thereasonparameter can optionally be used to control the response toonClose, for example ignoringclickaway.Signature: function(event: React.SyntheticEvent<any> | Event, reason: string) => voidevent: The event source of the callback. reason: Can be: "timeout"(autoHideDurationexpired),"clickaway", or"escapeKeyDown". | |
| open | bool | If  true, the component is shown. | |
| resumeHideDuration | number | The number of milliseconds to wait before dismissing after user interaction. If  autoHideDurationprop isn't specified, it does nothing. IfautoHideDurationprop is specified butresumeHideDurationisn't, we default toautoHideDuration / 2ms. | |
| slotProps | shape | {} | The props used for each slot inside the Snackbar. | 
| slots | shape | {} | The components used for each slot inside the Snackbar. Either a string to use a HTML element or a component. | 
The
ref is forwarded to the root element.