A set of customizable React components
npm install reui
npm install --save reui
`$3
`jsx
import React from 'react';
import ReactDOM from 'react-dom';
// Import the compiled version
import Reui from 'reui';
// or es6 version
import Reui from 'reui/es6';// Requires Webpack
import defaultTheme from 'reui/theme';
Reui.setGlobalTheme(defaultTheme);
ReactDOM.render(
,
document.body
);
`Creating and applying themes
Reui uses react-themeable under the hood so you can use jss, Radium, React Style, css-modules or plain classes to describe your theme.$3
Theme is just an object that associates components with its themes
`javascript
{
ComponentClass: {
componentElement: {theme}
}
}
`Exapmle:
`javascript
var theme = {
Button: {
button: 'button',
buttonDisabled: 'disabled',
buttonActive: 'active'
},
...
}
`
Then `` will be rendered as
`html
`$3
You can apply a theme globally:
`javascript
Reui.setGlobalTheme(theme)
`or directly to a component:
`jsx
`A theme passed as the
theme` prop will be merged with the global theme.