Modular and customizable Material Design UI components for the web
Switch branches/tags
v0.36.0-0 v0.35.2 v0.35.1 v0.35.0 v0.34.1 v0.34.0 v0.33.0 v0.32.0 v0.31.0 v0.30.0 v0.29.0 v0.28.0 v0.27.0 v0.26.0 v0.25.0 v0.24.0 v0.23.0 v0.22.0 v0.21.1 v0.21.0 v0.20.0 v0.19.0 v0.18.1 v0.18.0 v0.17.0 v0.16.0 v0.15.0 v0.13.0 v0.12.1 v0.12.0 v0.11.1 v0.11.0 v0.10.0 v0.9.1 v0.9.0 v0.8.0 v0.7.0 v0.6.0 v0.5.0 v0.4.0 v0.3.0 v0.2.0 v0.1.1 v0.1.0 @material/typography@0.3.0 @material/typography@0.2.3 @material/typography@0.2.2 @material/typography@0.2.1 @material/typography@0.2.0 @material/typography@0.1.1 @material/toolbar@0.4.11 @material/toolbar@0.4.10 @material/toolbar@0.4.9 @material/toolbar@0.4.8 @material/toolbar@0.4.7 @material/toolbar@0.4.6 @material/toolbar@0.4.5 @material/toolbar@0.4.4 @material/toolbar@0.4.3 @material/toolbar@0.4.2 @material/toolbar@0.4.1 @material/toolbar@0.4.0 @material/toolbar@0.3.3 @material/toolbar@0.3.2 @material/toolbar@0.3.1 @material/toolbar@0.3.0 @material/toolbar@0.2.2 @material/toolbar@0.2.1 @material/toolbar@0.2.0 @material/toolbar@0.1.2 @material/toolbar@0.1.0 @material/theme@0.4.0 @material/theme@0.3.1 @material/theme@0.3.0 @material/theme@0.2.0 @material/theme@0.1.7 @material/theme@0.1.6 @material/theme@0.1.5 @material/theme@0.1.4 @material/theme@0.1.3 @material/theme@0.1.2 @material/theme@0.1.1 @material/textfield@0.5.0 @material/textfield@0.4.1 @material/textfield@0.4.0 @material/textfield@0.3.6 @material/textfield@0.3.5 @material/textfield@0.3.4 @material/textfield@0.3.3 @material/textfield@0.3.2 @material/textfield@0.3.1 @material/textfield@0.3.0 @material/textfield@0.2.11 @material/textfield@0.2.10 @material/textfield@0.2.9 @material/textfield@0.2.8 @material/textfield@0.2.7 @material/textfield@0.2.6 @material/textfield@0.2.5 @material/textfield@0.2.4
Nothing to show
Clone or download
Pull request Compare This branch is 473 commits behind material-components:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
demos
docs
packages
scripts
test
.eslintignore
.eslintrc.yaml
.gitattributes
.gitignore
.mdc-docsite.yml
.stylelintrc.yaml
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENSE
README.md
app.yaml
closure_externs.js
karma.conf.js
lerna.json
package-lock.json
package.json
webpack.config.js

README.md

Build Status codecov Chat

Material Components for the web

Material Components for the web (MDC Web) helps developers execute Material Design. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional web projects.

Material Components for the web is the successor to Material Design Lite, and has 3 high-level goals:

MDC Web strives to seamlessly incorporate into a wider range of usage contexts, from simple static websites to complex, JavaScript-heavy applications to hybrid client/server rendering systems. In short, whether you're already heavily invested in another framework or not, it should be easy to incorporate Material Components into your site in a lightweight, idiomatic fashion.

Demos (updated with every release)

Quick start

Note: This guide assumes you have Node.js and npm installed locally.

Include CSS for a component

Note: This guide assumes you have webpack configured to compile Sass into CSS. See the getting started guide for pointers on how to configure webpack.

To include the Sass files for the Material Design button, install the Node dependency:

npm install @material/button

Then import the Sass files for @material/button into your application. You can also use Sass mixins to customize the button:

@import "@material/button/mdc-button";

.foo-button {
  @include mdc-button-ink-color(teal);
  @include mdc-states(teal);
}

You also need to configure sass-loader to understand the @material imports used by MDC Web. Update your webpack.config.js by changing { loader: 'sass-loader' } to:

{
  loader: 'sass-loader',
  options: {
    includePaths: ['./node_modules']
  }
}

@material/button has documentation about the required HTML for a button. Update your application's HTML to include the MDC Button markup, and add the foo-button class to the element:

<button class="foo-button mdc-button">
  Button
</button>

This will produce a customized Material Design button!

Button

Include JavaScript for a component

Note: This guide assumes you have webpack configured to compile ES2015 into JavaScript. See the getting started guide for pointers on how to configure webpack.

To include the ES2015 files for the Material Design ripple, install the dependency:

npm install @material/ripple

Then import the ES2015 file for @material/ripple into your application, and initialize an MDCRipple with a DOM element:

import {MDCRipple} from '@material/ripple';
const ripple = new MDCRipple(document.querySelector('.foo-button'));

This will produce a Material Design ripple on the button!

Button with Ripple

Useful Links

Browser Support

We officially support the last two versions of every major browser. Specifically, we test on the following browsers:

  • Chrome
  • Safari
  • Firefox
  • IE 11/Edge
  • Opera
  • Mobile Safari
  • Chrome on Android