# Material Web Components (@material/web) Material Web is Google's official implementation of Material Design 3 (M3) as web components. Built with Lit, it provides a comprehensive library of accessible, customizable UI components that work across all modern browsers and frameworks. The library delivers Material Design's expressive visual language through native web platform standards, enabling developers to create cohesive, beautiful user interfaces without framework lock-in. The components follow the Web Components specification, utilizing Custom Elements, Shadow DOM, and CSS Custom Properties (design tokens) for encapsulation and theming. Material Web emphasizes accessibility with built-in ARIA support, keyboard navigation, and form participation. All components integrate seamlessly with native HTML forms and can be themed using CSS custom properties that map to Material Design's token system for colors, typography, and shapes. ## Installation Install Material Web components via npm and import the components you need. ```bash npm install @material/web ``` ```javascript // Import specific components import '@material/web/button/filled-button.js'; import '@material/web/button/outlined-button.js'; import '@material/web/textfield/filled-text-field.js'; import '@material/web/checkbox/checkbox.js'; // Use in HTML // Click me ``` ## Button Components Buttons help users take actions and make choices with a single tap. Material Web provides filled, outlined, elevated, filled-tonal, and text button variants for different emphasis levels. ```html Submit Cancel Upload Save draft Learn more send Send message Visit site Disabled Soft disabled (focusable) ``` ## Text Field Components Text fields allow users to enter and edit text. They come in filled and outlined variants with support for labels, helper text, error states, and input types. ```html search clear
Sign up
``` ## Checkbox Component Checkboxes allow users to select one or more items from a set or toggle options on and off. They support checked, unchecked, and indeterminate states. ```html
Continue
``` ## Switch Component Switches toggle the state of a single item on or off, similar to a physical toggle switch. They're ideal for settings that take effect immediately. ```html
Save
``` ## Radio Button Component Radio buttons let users select one option from a set of mutually exclusive options. Radios with the same name form a group where only one can be selected. ```html

Select size

Confirm
``` ## Select Component Select menus display a list of choices on temporary surfaces, letting users pick one option from a fixed list. Available in filled and outlined variants. ```html
Apple
Banana
Orange
United States
United Kingdom
Canada
Low
Medium
High
``` ## Menu Component Menus display a list of choices on temporary surfaces, typically triggered by buttons. They support nested submenus, keyboard navigation, and typeahead functionality. ```html Open menu
Cut
Copy
Paste
Delete
Menu with submenus
Share
arrow_right
Email
Twitter
LinkedIn
Download
Option 1
Option 2
``` ## Dialog Component Dialogs provide important prompts in a user flow, displaying critical information or requesting decisions. They support headlines, content, and action buttons. ```html
Confirm action
Are you sure you want to delete this item? This action cannot be undone.
Cancel Delete
Delete item
Error
An error occurred while saving. Please try again.
OK
Connection lost. Reconnecting...
``` ## Tabs Component Tabs organize groups of related content at the same hierarchy level. Primary tabs appear at the top under app bars; secondary tabs provide further organization within content areas. ```html Videos Photos Music All Recent Favorites videocam Videos photo Photos audiotrack Music flight Flights hotel Hotels Videos Photos
Video content here...
``` ## Slider Component Sliders allow users to select a value or range from a track. They can be continuous, discrete with tick marks, or range sliders with two handles. ```html
``` ## Progress Indicators Progress indicators inform users about the status of ongoing processes. Linear progress shows progress along a track; circular progress shows progress in a ring. ```html
``` ## Chip Components Chips help users enter information, make selections, filter content, or trigger actions. Four types serve different purposes: assist, filter, input, and suggestion chips. ```html event

Categories

``` ## Floating Action Button (FAB) FABs represent the most important action on a screen, providing prominent access to key functionality. Available in standard, small, large, and extended variants. ```html add add edit edit edit add add add add edit ``` ## List Component Lists display continuous, vertical indexes of text and images. List items can be interactive (buttons/links) or static text. ```html
Inbox
5 unread messages
inbox 5
Sent
send
Drafts
drafts 2
Settings
settings chevron_right
View Profile
person
Help Center
help open_in_new
Vacation Photos
24 items
``` ## Icon Component Icons visually represent actions and content. Material Web supports Material Symbols fonts in outlined, rounded, and sharp styles. ```html settings favorite home home home home favorite favorite ``` ## Theming with Design Tokens Material Web uses CSS custom properties (design tokens) for comprehensive theming. Tokens cascade from system-level values to component-specific overrides. ```html Dark theme button ``` ## Summary Material Web provides a production-ready implementation of Material Design 3 for the web platform. The library excels in scenarios requiring consistent, branded UI components that work across frameworks and provide excellent accessibility out of the box. Its design token system enables sophisticated theming from global brand colors down to individual component customization, making it suitable for enterprise applications, design systems, and any project prioritizing Material Design's visual language. Key integration patterns include importing only needed components to minimize bundle size, leveraging CSS custom properties for theming at various scopes, and using the native form participation APIs for seamless integration with HTML forms. Components work with any framework (React, Vue, Angular, Svelte) or vanilla JavaScript. For complex applications, consider combining Material Web with state management libraries while relying on its built-in accessibility features for keyboard navigation, screen reader support, and ARIA compliance.