Skip to content

Commit

Permalink
Merge pull request #815 from Zadielerick/README
Browse files Browse the repository at this point in the history
Updated usage code and Theme description on README
  • Loading branch information
Hai Nguyen committed Jun 11, 2015
2 parents 63813fa + 0ccc302 commit c0c5822
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,36 @@ Once material-ui is included in your project, you can use the components this wa

var React = require('react'),
mui = require('material-ui'),
ThemeManager = new mui.Styles.ThemeManager(),
RaisedButton = mui.RaisedButton;

var MyAwesomeReactComponent = React.createClass({
var SomeAwesomeComponent = React.createClass({

childContextTypes: {
muiTheme: React.PropTypes.object
},

getChildContext() {
return {
muiTheme: ThemeManager.getCurrentTheme()
};
},

render: function() {
return (
<RaisedButton label="Default" />
<RaisedButton label="Default" />
);
}

});

module.exports = MyAwesomeReactComponent;

```

### Theme

Please note that since v0.8.0, you also need to define a theme for components to start working.

**Please note that since v0.8.0, you also need to define a theme for components to start working.** For instrucitons on implementing and using themes, visit our [documentation](http://material-ui.com/#/customization/themes).

## Customization

Expand Down

0 comments on commit c0c5822

Please sign in to comment.