Skip to content

Commit 926cf95

Browse files
committed
README initial version
1 parent 1e47f03 commit 926cf95

File tree

2 files changed

+70
-3
lines changed

2 files changed

+70
-3
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Javi Jiménez
3+
Copyright (c) 2015 React Toolbox Team
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+69-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,73 @@
33
[![Build Status](https://travis-ci.org/react-toolbox/react-toolbox.svg?branch=master)](https://travis-ci.org/react-toolbox/react-toolbox)
44
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/soyjavi/react-toolbox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55

6-
React-Toolbox is a set of React components that implement Google's Material Design specification.
7-
86
*Current version: [0.7.29]()*
7+
8+
React Toolbox is a set of [React](http://facebook.github.io/react/) components that implement [Google's Material Design specification](https://www.google.com/design/spec/material-design/introduction.html). It's powered by [CSS Modules](https://github.com/css-modules/css-modules) and integrates harmfully with your [Webpack](http://webpack.github.io/) workflow. You can take a tour through our documentation website and try the components live!
9+
10+
## Installation
11+
12+
React Toolbox can be installed as an [npm package](https://www.npmjs.org/package/material-ui);
13+
14+
```
15+
npm install --save react-toolbox
16+
```
17+
18+
## Usage
19+
20+
Although there are other ways to use React Toolbox, the recommended way is to create a Webpack workflow with [Babel Loader](https://github.com/babel/babel-loader), [CSS Loader](https://github.com/webpack/css-loader) and [SASS Loader](https://github.com/jtangelder/sass-loader). A good starting point is [React Hot Webpack Boilerplate](https://github.com/gaearon/react-hot-boilerplate).
21+
22+
Once you have the workflow ready, you can just require and use the components:
23+
24+
```jsx
25+
import React from 'react';
26+
import Button from 'react-toolbox/button';
27+
28+
const Button = () => (
29+
<Button label="Hello world" kind="raised" accent />
30+
);
31+
32+
export default Button;
33+
```
34+
35+
The previous code creates a React button component based on React toolbox button. It's important to notice that requiring a module from the exposed root of the package will try to import the **ES6 JSX** and **SASS** of the component. If you want to still use CSS Modules but avoiding [Babel](https://babeljs.io/) and [SASS](http://sass-lang.com/) you will need to require from `react-toolbox/lib`.
36+
37+
We encourage you to work with webpack but if you want to use React Toolbox in an old fashioned way you must generate a build with all the css and javascript and include it in your `index.html`. Then you can use the components exposed in the `window` object.
38+
39+
## Customization
40+
41+
Since React Toolbox styles are written in CSS it's pretty easy to customize your components. We have several ways:
42+
43+
### Via React Toolbox Loader (coming soon)
44+
45+
Thanks to the power of SASS, all components in React Toolbox are configured from a variables file. The best way to customize your build is to create a custom configuration SASS file with the variables you want to modify during the build process.
46+
47+
With `react-toolbox-loader` so you can tell webpack where your configuration file is. It will prepend your configuration to each build belonging to RT components resulting in your customized CSS. More on this soon.
48+
49+
### Via `className` property
50+
51+
Generally each component will have a `className` prop so you can tell the class name you want to keep in the root node of the resulting markup. All markup is style with the lowest specificity level so you can just nest one level in your CSS and the result will be applied. Consider this example:
52+
53+
```jsx
54+
const CustomButton = () => (
55+
<Button className='customized' label='Custom button' />
56+
);
57+
```
58+
59+
If you browse the resulting markup you will see *data attributes* like `data-role="label"` so you can avoid styling directly tag names. You can now write your CSS:
60+
61+
```css
62+
.customized > [data-role="label"] {
63+
color: green;
64+
font-weight: bold;
65+
}
66+
```
67+
68+
## Authors and Contributors
69+
70+
The project is being initially developed and maintained by [Javier Velasco](http://javivelasco.com) and [Javier Jiménez](http://soyjavi.com) and the [contribution](https://github.com/react-toolbox/react-toolbox/graphs/contributors) is just getting warm.
71+
72+
We want to create reference components so any contribution is very welcome.
73+
74+
## License
75+
This project is licensed under the terms of the [MIT license](https://github.com/react-toolbox/react-toolbox/blob/master/LICENSE).

0 commit comments

Comments
 (0)