March 2019
Intermediate to advanced
534 pages
14h 52m
English
The Snackbar components use SnackbackContent components to render the actual content that's displayed. In turn, SnackbarContent uses Paper, which uses Typography. It's kind of tricky to navigate through all of this indirection, but, thankfully, you don't have to. Instead, you can pass properties all the way to the Typography component from Snackbar via the ContentProps property.
Let's say that you wanted to use the h6 typography variant. Here's how you could do this:
import React from 'react';import Snackbar from '@material-ui/core/Snackbar';const MySnackbarContent () => ( <Snackbar open={true} message="Test" ContentProps={{ variant: 'h6' }} />);export default MySnackbarContent;
Any properties that you want to pass to the ...
Read now
Unlock full access