fluxible-plugin-material-ui
v1.0.0
Published
Simple plugin to provide the right context for material-ui
Downloads
7
Maintainers
Readme
Material Ui Plugin for Fluxible
Provides Material UI theme access to your Fluxible application.
Usage
var Fluxible = require('fluxible');
var muiPlugin = require('fluxible-plugin-material-ui');
var app = new Fluxible();
app.plug(muiPlugin());
Now, in your app component set the child context properly:
// ...
Application = provideContext(Application, {
muiTheme: React.PropTypes.object
});
module.exports = Application;
After that, you can just follow the Material UI docs to render your ui components.
Accessing the ThemeManager
If you want to customize your themes, you will need access to the theme manager. You will need to set an additional property in the child context in your app component:
// ...
Application = provideContext(Application, {
ThemeManager: React.PropTypes.object,
muiTheme: React.PropTypes.object
});
module.exports = Application;
Then, in your components:
componentDidMount: function () {
this.context.ThemeManager.setTheme(..)
}
License
This software is free to use under the Yahoo! Inc. BSD license. See the LICENSE file for license text and copyright information.