5.1.6 • Published 10 days ago

react-md v5.1.6

Weekly downloads
6,328
License
MIT
Repository
github
Last release
10 days ago

react-md

React Material Design - React components built with sass

Build Status Join the chat at Slack Donate

react-md is a set of React components and sass files for implementing Google's Material Design. The Documentation Website can be used for viewing live examples, code samples, and general prop documentation.

Installation

$ npm i -S react react-dom react-md

Customizing the theme

The application should define a primary and secondary color. The primary color should be chosen from one of the '-500' colors and the secondary should be one of the 'a-' colors.

The default color palette is defined as:

$md-primary-color: $md-indigo-500 !default;
$md-secondary-color: $md-pink-a-200 !default;

If you change these variables before the react-md-everything mixin is included, your entire application will be styled with your new theme.

@import '~react-md/src/scss/react-md';

$md-primary-color: $md-teal-500;
$md-secondary-color: $md-lime-a-400;

@include react-md-everything;

See the themes page on the documentation website. There is also a theme builder available to try mix and matching different colors.

Usage

Please see the list of examples for how you can get a project started off quickly with React and React MD.

UMD Usage

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="https://unpkg.com/react-md@1.2.11/dist/react-md.deep_purple-pink.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons|Roboto:400,500,700">
  </head>
  <body>
    <div id="app"></div>
    <script src="https://unpkg.com/react/dist/react-with-addons.min.js"></script>
    <script src="https://unpkg.com/react-dom/dist/react-dom.min.js"></script>
    <script src="https://unpkg.com/react-md@1.2.11/dist/react-md.min.js"></script>
    <script>
    var MyAwesomeComponent = React.createClass({
      render: function()  {
        return React.createElement(ReactMD.Button, { label: 'Hello, World!', flat: true });
      }
    });

    ReactDOM.render(React.createElement(MyAwesomeComponent), document.getElementById('app'));
    </script>
  </body>
</html>

Known Bugs/Works in Progress/Future Changes

  • Bottom sheets
  • Steppers
  • Eventually add Floating button transitions/morphing abilities. Ex: Speed Dial, Morph into toolbar/material/paper

Contributing

Please see the documentation site README for information about contributing using the documentation server. Otherwise, here is some information about only working within react-md.

Right now I am using the Ruby version of scss_lint to lint scss files. This means that you will need to have Ruby installed and the sass-lint gem.

$ gem install scss_lint

I have an issue (#274) open about switching over to the node port, but it hasn't really been worked on because I don't like the little amount of features that have been ported over so far.

Otherwise this should work on most systems with node >= 6.

Minimal Setup

mlaursen @ ~/code/react-md
$ yarn
$ cd docs
mlaursen @ ~/code/react-md/docs
$ yarn
$ cp .env.example .env
$ cd ..
mlaursen @ ~/code/react-md
$ yarn dev

Development Scripts

lint

This will run both the lint:styles and lint:scripts commands.

lint:fix

This will attempt to automatically fix any eslint errors that can be fixed.

lint:styles

As stated above, this will lint all the scss files within the src/scss directory. Unfortunately, this requires the Ruby gems version of scss-lint to be installed to work because the node port isn't quite there yet for me. You can either remove this temporarily from the build process or:

$ gem install scss_lint

lint:scripts

This will run eslint over all the files in the src/js folder.

dev

This command will run the build:

test

This command will run test:tsc followed by jest.

test:tsc

This will do a simple Typescript compliation test to make sure there aren't any syntax errors or invalid types. There should probably be a better testing system put in place.

test:watch

This will just run jest in watch mode.

test:docs

This will just run jest in the docs folder.

test:docs:watch

This will just run jest in watch mode in the docs folder.

test:all

This will run tests for Typescript definitions, the base react-md repo, and the docs folder.

tsd

This command will just copy all the Typescript definitions into the lib folder so that it can be used correctly by Typescript users.

css-bundles

This script makes 255 different scss files to be compiled for production use. This is automatically run before build.

scripts

This will compile all the components and utilities in the src/js using babel with the babel-preset-env. All the files will be output into the lib directory.

scripts:watch

This is the same as above, but it will be done in watch mode. This is very helpful when running the development server and want to see immediate changes.

dev

This will start up the documentation server in development mode as well as watching for changes within the base react-md library. Please look at the Getting Started for some preliminary setup required.

dev:minimal

This will start up the documentation server in development mode as well as watching for changes within the base react-md library. The only difference is that the docs:minimal command will be run instead of docs

docs

This will start up the documentation server in development mode. For some more information about this command, please see the documentation server scripts.

docs:minimal

This will start up the documentation server in development mode without rebuilding all the "databases" before startup.

prebuild

This command is automatically run before build. It will basically remove all the old artifacts and compiled files followed by linting the entire project.

build

This command will do the full build of react-md before a release. It runs almost all of the other scripts in a specified order so that the es, lib,dist folders are created and contain the correct files for release.

build:umd

This command will create the UMD bundles for development and production use. In addition, it will create all the pre-compiled css bundles for production use.

6.0.0-next.1

10 days ago

5.1.6

5 months ago

4.0.4

12 months ago

3.1.2

12 months ago

5.1.5

12 months ago

2.9.2

12 months ago

5.1.4

2 years ago

5.1.3

2 years ago

5.1.2

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

4.0.3

2 years ago

5.0.0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.2

2 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

3.0.1-alpha.2

3 years ago

3.0.1-alpha.1

3 years ago

3.0.1-alpha.0

3 years ago

3.0.0-alpha.0

3 years ago

2.9.1

3 years ago

2.9.0

3 years ago

2.8.5

3 years ago

2.8.4

3 years ago

2.8.1

3 years ago

2.8.0

3 years ago

2.8.3

3 years ago

2.8.2

3 years ago

2.7.1

3 years ago

2.7.0

3 years ago

2.6.0

3 years ago

2.5.5

3 years ago

2.5.4

3 years ago

2.5.3

3 years ago

2.5.2

3 years ago

2.5.1

3 years ago

2.5.0

3 years ago

2.4.3

3 years ago

2.4.2

4 years ago

2.4.1

4 years ago

2.4.0

4 years ago

1.18.1

4 years ago

2.3.1

4 years ago

1.18.0

4 years ago

2.3.0

4 years ago

1.17.0

4 years ago

2.3.0-alpha.3

4 years ago

2.3.0-alpha.2

4 years ago

2.3.0-alpha.1

4 years ago

2.2.1

4 years ago

2.2.2

4 years ago

2.3.0-alpha.0

4 years ago

2.2.0

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.0.4

4 years ago

2.1.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-beta.2

4 years ago

2.0.0-beta.1

4 years ago

2.0.0-beta.0

4 years ago

2.0.0-alpha.15

4 years ago

1.16.1

4 years ago

1.16.0

4 years ago

1.15.0

4 years ago

1.15.1

4 years ago

2.0.0-alpha.14

4 years ago

2.0.0-alpha.13

4 years ago

1.14.1

4 years ago

2.0.0-alpha.12

4 years ago

1.14.0

4 years ago

2.0.0-alpha.11

4 years ago

1.13.0

4 years ago

1.12.4

4 years ago

2.0.0-alpha.10

5 years ago

1.12.3

5 years ago

2.0.0-alpha.9

5 years ago

2.0.0-alpha.8

5 years ago

2.0.0-alpha.7

5 years ago

2.0.0-alpha.6

5 years ago

1.12.2

5 years ago

2.0.0-alpha.5

5 years ago

2.0.0-alpha.4

5 years ago

2.0.0-alpha.3

5 years ago

1.12.1

5 years ago

1.12.0

5 years ago

1.11.0

5 years ago

1.10.2

5 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1

5 years ago

1.10.1

5 years ago

1.10.0

5 years ago

2.0.0-alpha.0

5 years ago

1.9.3

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.0

6 years ago

1.7.2

6 years ago

1.7.1

6 years ago

1.7.0

6 years ago

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.13

6 years ago

1.2.12

6 years ago

1.2.12-beta.2

6 years ago

1.2.12-beta

6 years ago

1.2.11

6 years ago

1.2.10

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.1.0-alpha-9

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.1.0-alpha-8

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.1.0-alpha-7

7 years ago

1.1.0-alpha-6

7 years ago

1.1.0-alpha-5

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.1.0-alpha-4

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.1.0-alpha-3

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.1.0-alpha-1

7 years ago

1.1.0-alpha

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-beta

7 years ago

1.0.0-alpha.4

7 years ago

1.0.0-alpha.3

7 years ago

1.0.0-alpha.2

7 years ago

1.0.0-alpha.1

7 years ago

1.0.0-alpha

7 years ago

0.3.7

8 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.1.0-beta

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

9 years ago