Skip to content

Vijar/fluxible-plugin-material-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Rajiv Tirumalareddy
Sep 11, 2015
9f0e064 · Sep 11, 2015

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Simple plugin to provide the right context for material-ui

Resources

License

Stars

Watchers

Forks

Packages

No packages published