|
1 | 1 | # Material Web
|
2 | 2 |
|
3 |
| -Material |
4 |
| -[web components](https://developer.mozilla.org/en-US/docs/Web/Web_Components)<!-- {.external} --> |
5 |
| -is a UI toolkit to build customizable and accessible web applications. |
| 3 | +<img src="./docs/images/material-web.gif" |
| 4 | + title="Material web components" |
| 5 | + alt="A collection of Material web components" |
| 6 | + style="border-radius: 32px"> |
6 | 7 |
|
7 |
| -[Material 3](https://m3.material.io/)<!-- {.external} --> is the latest version of |
8 |
| -Google's open-source design system. |
| 8 | +[](https://www.npmjs.com/package/@material/web) |
| 9 | +[](https://lit.dev/discord/) |
| 10 | +[](https://github.com/material-components/material-web/actions/workflows/test.yml) |
| 11 | +[](https://npm-stat.com/charts.html?package=%40material%2Fweb) |
| 12 | +[](https://www.jsdelivr.com/package/npm/@material/web?tab=stats) |
9 | 13 |
|
10 |
| -> Tip: Using Angular? We recommend using |
11 |
| -> [Angular Material](https://material.angular.io/)<!-- {.external} --> components |
12 |
| -> instead. |
| 14 | +`@material/web` is a library of |
| 15 | +[web components](https://developer.mozilla.org/en-US/docs/Web/Web_Components)<!-- {.external} --> |
| 16 | +that helps build beautiful and accessible web applications. It uses |
| 17 | +[Material 3](https://m3.material.io/)<!-- {.external} -->, the latest version of Google's |
| 18 | +open-source design system. |
13 | 19 |
|
14 |
| -**Resources** |
| 20 | +## Resources |
15 | 21 |
|
16 | 22 | - [Introduction](./docs/intro.md)
|
17 | 23 | - [Roadmap](./docs/roadmap.md)
|
18 |
| -- [Quick start](./docs/quick-start.md) |
19 |
| -- [Bundle sizes](./docs/size.md) |
20 | 24 | - [Component docs](./docs/components/)
|
| 25 | +- [Bundle size](./docs/size.md) |
21 | 26 | - [Browser support and FAQ](./docs/support.md)
|
| 27 | + |
| 28 | +## Quick start |
| 29 | + |
| 30 | +> Tip: Using Angular? We recommend using |
| 31 | +> [Angular Material](https://material.angular.io/)<!-- {.external} --> components |
| 32 | +> instead. |
| 33 | +
|
| 34 | +This code snippet is a buildless example that loads `@material/web` from a CDN. |
| 35 | +Check out the [quick start](./docs/quick-start.md) guide to install and build |
| 36 | +for production. |
| 37 | + |
| 38 | +<!-- LINT.IfChange --> |
| 39 | + |
| 40 | +```html |
| 41 | +<head> |
| 42 | + <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet"> |
| 43 | + <script type="importmap"> |
| 44 | + { |
| 45 | + "imports": { |
| 46 | + "@material/web/": "https://esm.run/@material/web/" |
| 47 | + } |
| 48 | + } |
| 49 | + </script> |
| 50 | + <script type="module"> |
| 51 | + import '@material/web/all.js'; |
| 52 | + import {styles as typescaleStyles} from '@material/web/typography/md-typescale-styles.js'; |
| 53 | +
|
| 54 | + document.adoptedStyleSheets.push(typescaleStyles.styleSheet); |
| 55 | + </script> |
| 56 | +</head> |
| 57 | +<body> |
| 58 | + <h1 class="md-typescale-display-medium">Hello Material!</h1> |
| 59 | + <form> |
| 60 | + <p class="md-typescale-body-medium">Check out these controls in a form!</p> |
| 61 | + <md-checkbox></md-checkbox> |
| 62 | + <div> |
| 63 | + <md-radio name="group"></md-radio> |
| 64 | + <md-radio name="group"></md-radio> |
| 65 | + <md-radio name="group"></md-radio> |
| 66 | + </div> |
| 67 | + |
| 68 | + <md-outlined-text-field label="Favorite color" value="Purple"></md-outlined-text-field> |
| 69 | + |
| 70 | + <md-outlined-button type="reset">Reset</md-outlined-button> |
| 71 | + </form> |
| 72 | + <style> |
| 73 | + form { |
| 74 | + display: flex; |
| 75 | + flex-direction: column; |
| 76 | + align-items: flex-start; |
| 77 | + gap: 16px; |
| 78 | + } |
| 79 | + </style> |
| 80 | +</body> |
| 81 | +``` |
| 82 | + |
| 83 | +<!-- LINT.ThenChange(./g3doc/docs/quick-start.md) --> |
0 commit comments