# react-md **Repository Path**: mirrors_fkhadra/react-md ## Basic Information - **Project Name**: react-md - **Description**: React material design - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-01-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # react-md React Material Design - React components built with sass [![Build Status](https://travis-ci.org/mlaursen/react-md.svg?branch=master)](https://travis-ci.org/mlaursen/react-md) [![Join the chat at Slack](https://react-md.herokuapp.com/badge.svg)](https://react-md.herokuapp.com) [![Join the chat at https://gitter.im/mlaursen/react-md](https://badges.gitter.im/mlaursen/react-md.svg)](https://gitter.im/mlaursen/react-md?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/mlaursen03) react-md is a set of React components and sass files for implementing [Google's Material Design](https://material.google.com). The [Documentation Website](http://react-md.mlaursen.com) can be used for viewing live examples, code samples, and general prop documentation. ## Installation ```bash $ npm i -S react \ react-dom \ react-addons-transition-group \ react-addons-css-transition-group \ react-md ``` ## Usage ### Using create-react-app `create-react-app` does [not support Sass](https://github.com/facebookincubator/create-react-app/issues/78), so here are some steps to get it working: ```bash $ create-react-app my-app --scripts-version --custom-react-scripts $ npm i -S react-md ``` Customize the `.env` to include SASS. See [custom-react-scripts](https://github.com/kitze/create-react-app) for more information. If this is not a solution for you, you can always run `yarn run eject` (or `npm run eject`) from your app and add Sass yourself. ```bash $ create-react-app my-app $ yarn run eject $ yarn add react-md $ yarn add --dev sass-loader node-sass $ vim -O config/webpack.config.dev.js config/webpack.config.prod.js ``` Add an scss/sass exclusion on line 109 (webpack.config.dev.js) and line 115 (webpack.config.prod.js) ```js exclude: [ /\.html$/, /\.(js|jsx)$/, /\.css$/, /\.json$/, /\.svg$/, /\.s(c|a)ss$/, ], ``` In the dev config, add a new loader after the CSS loader: ```js { test: /\.s(a|c)ss$/, loader: 'style!css?importLoaders=2!postcss!sass?sourceMap&outputStyle=expanded' }, ``` In the prod config: ```js { test: /\.s(a|c)ss$/, loader: ExtractTextPlugin.extract('style', 'css?importLoaders=2!postcss!sass?outputStyle=compressed') }, ``` ### Using one of the Boilerplates If `create-react-app` is not your thing, you can try using one of the available [boilerplates](https://react-md.mlaursen.com/discover-more/boilerplates). ### Basic Webpack Usage ```js /* App.jsx */ import React from 'react'; import { render } from 'react-dom'; import WebFont from 'webfontloader'; WebFont.load({ google: { families: ['Roboto:300,400,500,700', 'Material Icons'], }, }); import './_styles.scss'; import MyAwesomeComponent from './MyAwesomeComponent'; const App = () => ( ); render(, document.getElementById('app')); ``` ```js /* MyAwesomeComponent.jsx */ import React, { Component } from 'react'; import Button from 'react-md/lib/Buttons'; export default class MyAwesomeComponent extends Component { render() { return