Develop
How material is built, and how to use it in your framework. Each component's API is on its Develop tab.
Architecture
Architecture
The material library is built in layers: small features compose into component factories, web components wrap the factories, and the React, Vue, Svelte and Solid components are generated from the web components.
Factory
The factories are material itself: one function per component, which builds its DOM and returns an object to drive it.
Web Components
material/elements has every component as a custom element: <m-switch>, <m-tabs>, <m-dialog>.
Server rendering
material's components are built in the browser: a web component builds its factory inside its shadow root when it upgrades, and a factory needs document.
Events and overlays
Two rules hold for every factory, and the overlays add a few of their own.
Markup and sanitizing
Icons and content options are markup: the library writes them as HTML.
Frameworks
Frameworks
Choose the guide for your framework.
React
material/react has a React component for every element: Switch renders <m-switch>, Tabs renders <m-tabs>.
Vue
material/vue has a Vue 3 component for every material web component, for Vue 3.3 or later and Nuxt.
Svelte
material/svelte has a Svelte 5 component for every material web component, for Svelte apps and SvelteKit.
Solid
material/solid has a Solid component for every material web component, for Solid 1 (1.8 or later) and SolidStart.
Styling
Stylesheets
Which stylesheet to import, and what each one holds.
Tailwind CSS
How to use material beside Tailwind CSS 4: one line orders the cascade layers, and a theme block turns the Material tokens into utilities.
Layout
Scaffold
The scaffold is a frame for a screen, or for any part of one.
Bundle size
Bundle size
material is tree-shakable: an app pays for the components it imports, and nothing else.