Forked react-toolbox with some fixes
 
 
 
 
Go to file
Javi Velasco 33ff49119b Fix linter errors 2016-05-10 21:33:34 +02:00
components Fix linter errors 2016-05-10 21:33:34 +02:00
docs Merge pull request #447 from mjurincic/dev 2016-05-10 20:22:08 +02:00
spec Reduce z-index for spec page 2016-05-10 19:59:30 +02:00
tools Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
.babelrc Replace transition-property to transition for Issue#230 2015-12-23 23:47:29 -07:00
.bumpedrc Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
.editorconfig Migrate button, ripple and font icon styles to sass and add sass tooling 2015-10-02 17:39:26 +02:00
.eslintignore use react-transform 2015-10-29 13:33:21 +08:00
.eslintrc Update linting 2016-04-10 17:49:23 +02:00
.gitignore Set font URLs as variables 2015-11-09 03:46:52 +01:00
.npmignore add .npmgnore 2015-11-25 09:38:00 -05:00
.nvmrc Update dependencies, linter and rules 2016-04-09 20:34:34 +02:00
.sass-lint.yml Use sass lint 2016-04-10 12:20:59 +02:00
.travis.yml Update dependencies, linter and rules 2016-04-09 20:34:34 +02:00
CHANGELOG.md keepachangelog.com :) 2016-03-31 11:08:57 +02:00
LICENSE README initial version 2015-11-01 17:52:07 +01:00
README.md Remove unneeded App 2016-04-10 17:44:42 +02:00
karma.conf.js Fixed linting issues 2015-12-23 23:58:43 -07:00
package.json Update dependencies 2016-05-10 19:02:02 +05:30
react-toolbox.d.ts Add <Chip> export 2016-04-27 12:49:39 -07:00
server.js Fixe autocomplete 2016-01-06 12:56:30 +01:00
tests.webpack.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
webpack.config.development.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
webpack.config.test.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00

README.md

React Toolbox

npm version Build Status NPM Status react-toolbox channel on discord Donate

React Toolbox is a set of React components that implement Google's Material Design specification. It's powered by CSS Modules and harmoniously integrates with your webpack workflow. You can take a tour through our documentation website and try the components live!

Installation

React Toolbox can be installed as an npm package:

npm install --save react-toolbox

Usage

Although there are other ways to use React Toolbox, the recommended way is to create a webpack workflow with babel-loader, css-loader and sass-loader. A good starting point is React Hot Webpack Boilerplate.

Once you have the workflow ready, you can just require and use the components:

import React from 'react';
import Button from 'react-toolbox/lib/button';

const CustomButton = () => (
  <Button label="Hello world" raised accent />
);

export default CustomButton;

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 also import the SASS of the component.

Roboto Font and Material Design Icons

React Toolbox assumes that you are importing Roboto Font and Material Design Icons.

In order to import the fonts for you, we'd need to include them in the CSS which is considered a bad practice. If you are not including them in your app, go to the linked sites and follow the instructions.

Customization

Since React Toolbox styles are written in CSS, it's pretty easy to customize your components. We have several ways:

Via React Toolbox Loader

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 overriding configuration variables like colors or sizes.

With toolbox-loader you can tell webpack where your configuration file is and it will prepend your config to each SASS build. This will result in your customized CSS for React Toolbox Components. For now you can browse the configuration files and override what you want.

Via className property

Generally each component will have a className prop so you can pass the class name you want to keep in the root node of the resulting markup. All markup is styled with the lowest specificity level so you can just nest one level in your CSS and the result will be applied. Consider this example:

const CustomButton = () => (
  <Button className='customized' label='Custom button' />
);

If you browse the resulting markup you will see data attributes like data-react-toolbox="label" so you can avoid directly styling tag names. You can now write your CSS:

.customized > [data-react-toolbox="label"] {
  color: green;
  font-weight: bold;
}

TypeScript

A TypeScript definition file react-toolbox.d.ts is available. It is referenced in package.json and should be picked up by the TypeScript compiler when importing from the npm package.

Note that to comply with the typings requirement, a triple-slash reference to react.d.ts is NOT included. You will need to reference react.d.ts somewhere in your project.

Authors and Contributors

The project is being initially developed and maintained by Javier Velasco and Javier Jiménez and the contribution scene is just getting warm. We want to create reference components so any contribution is very welcome.

To work in the project you'd need a node version supporting ES6 syntax. Although the project is built using Babel we use some ES6 features in the development server. Also, the package has been tested with node 4.2.1. Consider using nvm or n to handle different node versions!

To start the documentation site locally, you'll need to install the dependencies from both the main package and the docs subproject:

git clone https://github.com/react-toolbox/react-toolbox.git
npm install
cd docs/
npm install
npm start

Local documentation will then be available at http://localhost:8081/.

License

This project is licensed under the terms of the MIT license.