SnackbarProps
Properties
The anchor of the Snackbar
. On smaller screens, the component grows to occupy all the available width, the horizontal alignment is ignored.
The number of milliseconds to wait before automatically calling the onClose
function. onClose
should then set the state of the open
prop to hide the Snackbar. This behavior is disabled by default with the null
value.
Override or extend the styles applied to the component.
Props applied to the ClickAwayListener
element.
Props applied to the /material-ui/api/snackbar-content/ element.
If true
, the autoHideDuration
timer will expire even if the window is not focused.
When displaying multiple consecutive snackbars using a single parent-rendered <Snackbar/>
, add the key
prop to ensure independent treatment of each message. For instance, use <Snackbar key={message} />
. Otherwise, messages might update in place, and features like autoHideDuration
could be affected.
Callback fired when the component requests to be closed. Typically onClose
is used to set state in the parent component, which is used to control the Snackbar
open
prop. The reason
parameter can optionally be used to control the response to onClose
, for example ignoring clickaway
.
The number of milliseconds to wait before dismissing after user interaction. If autoHideDuration
prop isn't specified, it does nothing. If autoHideDuration
prop is specified but resumeHideDuration
isn't, we default to autoHideDuration / 2
ms.
The component used for the transition. /material-ui/transitions/#transitioncomponent-prop to learn more about the requirements for this component.
The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object.
Props applied to the transition element. By default, the element is based on this Transition
component.