GithubHelp home page GithubHelp logo

iarnaud / react-toolbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from react-toolbox/react-toolbox

0.0 1.0 0.0 2.03 MB

A set of React components implementing Google's Material Design specification with the power of CSS Modules

Home Page: http://www.react-toolbox.com

License: MIT License

CSS 47.92% JavaScript 51.74% HTML 0.34%

react-toolbox's Introduction

React Toolbox

Build Status Gitter Donate

Current version: 0.11.2

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/button';

const CustomButton = () => (
  <Button label="Hello world" kind="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 import the SASS of the component.

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.

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 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:

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

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:

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

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.

License

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

react-toolbox's People

Contributors

felipemsantana avatar javivelasco avatar soyjavi avatar ustccjw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.