A background react element based on material-ui.
Install material-ui-background
.
npm install material-ui-background
Then install its peer dependencies, if you haven't already:
npm install react material-ui
Provide a background color through the MuiThemeProvider
. Then use the Background
component as a generic background for your app.
import { getMuiTheme, lightBaseTheme, MuiThemeProvider } from 'material-ui/styles';
import Background, { appendMuiBackground, dark, light } from 'material-ui-background';
import React from 'react';
import { render } from 'react-dom';
const color = light; // or dark
render(
<MuiThemeProvider theme={appendMuiBackground(getMuiTheme(lightBaseTheme), color)}>
<Background />
</MuiThemeProvider>,
document.getElementById('root'),
)
MIT