jssql jssql - 1 year ago 197
React JSX Question

Set color of a snackbar element from material-ui

I am using a snackbar component from material-ui. At the moment the snackbar appear in black. Do you know how I can change the color? Background-color only changes the color of the whole div in which the snackbar is present. It does not change the color of the snackbar.

Answer Source

You have to set the bodyStyle property:

<Snackbar bodyStyle={{ backgroundColor: 'teal', color: 'coral' }} />

Ref the documentation

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download