react-mdc-web

React web components for Material Design

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-mdc-web
173340.17.07 years ago7 years agoMinified + gzip package size for react-mdc-web in KB

Readme

!Maintenance Statusstatus-imagestatus-url !NPM versionnpm-imagenpm-url !Travis buildtravis-imagetravis-url
React components based on styles from Material Design Components Web project. Components are written in React.js. Doesn't use MDC foundation classes.

Installation

From CDN
<script src="https://unpkg.com/react-mdc-web/out/react-mdc-web.js"></script>
From package manager
npm i --save react-mdc-web

Theming

Default theme

  • Include CSS with default theme into HTML page
```html ```
  • Or import it into JS/JSX file
```javascript // MyApp/index.js import 'material-components-web/dist/material-components-web.min.css'; ```

Custom theme

Override default theme colors with Sass or with CSS Custom Properties, just follow these guides: Changing the theme with Sass Changing the theme with CSS Custom Properties

Usage

import React, { Component } from 'react'
import {Card, CardHeader, CardTitle, CardText, CardActions, Button} from 'react-mdc-web/lib';

class MyComponent extends Component {
  render() {
    return (
        <Card>
          <CardHeader>
            <CardTitle>
              Title goes here
            </CardTitle>
          </CardHeader>
          <CardText>
            Lorem ipsum dolor sit amet, sint adipiscing ius eu
          </CardText>
          <CardActions>
            <Button compact>Save</Button>
            <Button compact accent>Remove</Button>
          </CardActions>
        </Card>
    );
  }
}
More samples could be found on the Documentation Site

License

MIT, see LICENSE for details