notistack
Advanced tools
Changelog
notistack@1.0.0
SnackbarContent
component and ContentProps
props #297className
prop is now used to customise styles applied to the content of snackbar (e.g. backgroundColor).className
to apply styles to Snackbar
component, you should now do so using classes.root
.<SnackbarProvider
- className={classes.snackbar}
+ classes={{
+ root: classes.snackbar
+ }}
>
ContentProps
prop is not supported anymore. Here are alternative ways to pass the same data to snackbar component. For any other
scenario, you should pass you own custom content.<SnackbarProvider
- ContentProps={{
- action: () => <button>dismiss</button>,
- 'aria-describedby': 'some-value',
- }}
+ action={() => <button>dismiss</button>}
+ ariaAttributes={{
+ 'aria-describedby': 'some-value'
+ }}
>
MuiSnackbarContent
through Material-UI theme
object, these changes won't automatically
reflect within notistack. You can however, use className
prop to apply your customisations.const theme = createMuiTheme({
overrides: {
// no effect within notistack
MuiSnackbarContent: {
root: {
fontSize: '1rem',
},
},
},
});
<br />