fluxible-plugin-material-ui

1.0.0 • Public • Published

Material Ui Plugin for Fluxible

npm version Build Status Dependency Status devDependency Status Coverage Status

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.

Package Sidebar

Install

npm i fluxible-plugin-material-ui

Weekly Downloads

3

Version

1.0.0

License

none

Last publish

Collaborators

  • vijar