SnackbarUnstyled API
Importação
import SnackbarUnstyled from '@mui/base/SnackbarUnstyled';
// ou
import { SnackbarUnstyled } from '@mui/base';Propriedades
Propriedades do componente nativo também estão disponíveis.
| Nome | Tipo | Padrão | Descrição | 
|---|---|---|---|
| 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 slot. Either a string to use a HTML element or a component. This is equivalent to  components.Root. If both are provided, thecomponentis used. | |
| disableWindowBlurListener | bool | false | If  true, theautoHideDurationtimer will expire even if the window is not focused. | 
| exited | bool | true | |
| 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 | false | 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 | { clickAwayListener?: func | { children: element, disableReactTree?: bool, mouseEvent?: 'onClick' | 'onMouseDown' | 'onMouseUp' | 'onPointerDown' | 'onPointerUp' | false, onClickAway?: func, touchEvent?: 'onTouchEnd' | 'onTouchStart' | false }, root?: func | object } | {} | |
| slots | { root?: elementType } | {} | 
O
ref é encaminhado para o elemento raiz.