material-components /material-components-web
Modular and customizable Material Design UI components for the web
★ 17,027⑂ 2,120👁 13⑃ 5,120● 2,928▤ 11
More from this author
+0
Daily
17,027
stars
2,120
forks
13
watchers
5,120
prs
2,928
issues
11
releases
README
Note:
This project is no longer actively maintained. While automated updates may
still occur, the team will not be prioritizing new features or bug fixes, and
those updates will be turned off in the future.
For Angular users, our friends at Angular Material moved away from this
library, and they expect that this may actually allow for faster iteration - see
their blog post
for more information.
Material Components for the web
Material Components for the 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 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.
Material Components for the web is the successor to Material Design Lite. In addition to implementing the Material Design guidelines, it provides more flexible theming customization, not only in terms of color, but also typography, shape, states, and more. It is also specifically architected for adaptability to various major web frameworks.
NOTE: Material Components Web tends to release breaking changes on a monthly basis, but follows
semver so you can control when you incorporate them.
We typically follow a 2-week release schedule which includes one major release per month with breaking changes,
and intermediate patch releases with bug fixes.
Important links
- Getting Started Guide
- Demos (external site)
- Material on other frameworks
- Examples using Material Web
- Contributing
- Material Design Guidelines (external site)
- Supported browsers
- All Components
- Changelog
Quick start
Using via CDN
html
Label
mdc.textField.MDCTextField.attachTo(document.querySelector('.mdc-text-field'));
Please see quick start demo on codepen for full example.
Using NPM
This guide assumes you have webpack configured to compile Sass into CSS. To configure webpack, please see the full getting started guide. You can also see the final code and result in the Material Starter Kit.
Install textfield node module to your project.
npm install @material/textfield
HTML
Sample usage of text field component. Please see Textfield component page for more options.
html
Label
CSS
Load styles required for text field component.
scss
@use "@material/floating-label/mdc-floating-label";
@use "@material/line-ripple/mdc-line-ripple";
@use "@material/notched-outline/mdc-notched-outline";
@use "@material/textfield";
@include textfield.core-styles;
JavaScript
Import MDCTextField module to instantiate text field component.
js
import {MDCTextField} from '@material/textfieLatest release
v14.0.0 v14.0.0 2022-04-28See CHANGELOG file to see what's changed in new release.