Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Modular and customizable Material Design UI components for the web

License

NotificationsYou must be signed in to change notification settings

material-components/material-components-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

VersionChat

Note:

This project is no longer actively maintained. While automated updates maystill occur, the team will not be prioritizing new features or bug fixes, andthose updates will be turned off in the future.

For Angular users, our friends at Angular Material moved away from thislibrary, and they expect that this may actually allow for faster iteration - seetheirblog postfor more information.

Material Components for the web

Material Components for the web helps developers executeMaterial 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 toMaterial Design Lite. In addition to implementing theMaterial Design guidelines, it provides more flexible theming customization, not only in terms of color, but also typography, shape, states, and more. It is also specificallyarchitected for adaptability to variousmajor web frameworks.

NOTE: Material Components Web tends to release breaking changes on a monthly basis, but followssemver 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

Quick start

Using via CDN

<!-- Required styles for Material Web --><linkrel="stylesheet"href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css"><!-- Render textfield component --><labelclass="mdc-text-field mdc-text-field--filled"><spanclass="mdc-text-field__ripple"></span><spanclass="mdc-floating-label"id="my-label">Label</span><inputtype="text"class="mdc-text-field__input"aria-labelledby="my-label"><spanclass="mdc-line-ripple"></span></label><!-- Required Material Web JavaScript library --><scriptsrc="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.js"></script><!-- Instantiate single textfield component rendered in the document --><script>mdc.textField.MDCTextField.attachTo(document.querySelector<HTMLElement>('.mdc-text-field'));</script>

Please seequick 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 fullgetting started guide. You can also see the final code and result in theMaterial Starter Kit.

Install textfield node module to your project.

npm install @material/textfield

HTML

Sample usage of text field component. Please seeTextfield component page for more options.

<labelclass="mdc-text-field mdc-text-field--filled"><spanclass="mdc-text-field__ripple"></span><inputtype="text"class="mdc-text-field__input"aria-labelledby="my-label"><spanclass="mdc-floating-label"id="my-label">Label</span><spanclass="mdc-line-ripple"></span></label>

CSS

Load styles required for text field component.

@use"@material/floating-label/mdc-floating-label";@use"@material/line-ripple/mdc-line-ripple";@use"@material/notched-outline/mdc-notched-outline";@use"@material/textfield";@includetextfield.core-styles;

JavaScript

ImportMDCTextField module to instantiate text field component.

import{MDCTextField}from'@material/textfield';consttextField=newMDCTextField(document.querySelector<HTMLElement>('.mdc-text-field'));

This'll initialize text field component on a single.mdc-text-field element.

Please seequick start demo on glitch for full example.

Need help?

We're constantly trying to improve our components. If Github Issues don't fit your needs, then please visit us on ourDiscord Channel.


[8]ページ先頭

©2009-2025 Movatter.jp