m3-web-svelte
Material Design 3 — Svelte / SMUI
Overview
SMUI (Svelte Material UI) wraps Google's MDC-Web foundation logic in Svelte-native components. Evolving towards M3 with MDC v10 integration. Svelte 5 compatible (v8+). Alternatively, use @material/web directly — Svelte has excellent Custom Elements support.
Keywords: Material Design 3, M3, Svelte, SMUI, Svelte Material UI, SvelteKit, web components, MDC
When to Use
- Svelte or SvelteKit projects
- When you want Svelte-native Material components
- Projects that can also use
@material/webdirectly (Svelte handles Custom Elements well)
Install (SMUI)
npm install svelte-material-ui
Individual packages:
npm install @smui/button @smui/card @smui/textfield @smui/top-app-bar
Install (@material/web — alternative)
npm install @material/web
SMUI Component Examples
Buttons
<script>
import Button from '@smui/button';
</script>
<Button variant="raised">Filled</Button>
<Button variant="outlined">Outlined</Button>
<Button>Text</Button>
Cards
<script>
import Card from '@smui/card';
</script>
<Card>
<div class="card-content">
<h2>Card Title</h2>
<p>Card content</p>
</div>
</Card>
Text Fields
<script>
import Textfield from '@smui/textfield';
</script>
<Textfield variant="outlined" label="Email" />
<Textfield variant="filled" label="Name" />
Using @material/web in Svelte
Svelte handles web components natively:
<script>
import '@material/web/button/filled-button.js';
import '@material/web/textfield/outlined-text-field.js';
import '@material/web/checkbox/checkbox.js';
</script>
<md-filled-button>Click me</md-filled-button>
<md-outlined-text-field label="Email"></md-outlined-text-field>
<md-checkbox></md-checkbox>
Theme via CSS custom properties in your global stylesheet:
:root {
--md-sys-color-primary: #6750A4;
--md-sys-color-on-primary: #FFFFFF;
--md-ref-typeface-brand: 'Roboto';
}
Checklist
- Choose between SMUI and @material/web based on project needs
- M3 color tokens applied via CSS custom properties or SMUI theming
- Components use M3-aligned variants
- Both light and dark themes supported
- Svelte 5 compatibility verified (SMUI v8+)
Resources
- SMUI: https://sveltematerialui.com/
- SMUI GitHub: https://github.com/hperrin/svelte-material-ui
- @material/web (works in Svelte): https://material-web.dev/
- @material/web GitHub: https://github.com/material-components/material-web
More from shelbeely/shelbeely-agent-skills
material-design-3-guide
Master guide for Material Design 3 — covering the full specification from Material You foundations through M3 Expressive. Explains when to use each Material Design 3 skill subset (color, motion, typography, shape, layout, components, icons). Use this when starting a Material Design 3 project, when you need to understand which M3 skill to apply, or when the user asks about Material Design 3 in general.
28material-design-3-components
Comprehensive guide to Material Design 3 components — from baseline Material You through M3 Expressive. Covers action, containment, communication, navigation, selection, and text input components with specifications, states, and implementation guidelines. Use this when building or styling UI components following Material Design 3 guidelines.
27material-design-3-typography
Applies Material Design 3 Expressive typography principles including variable fonts, type scales, and hierarchy. Use this when working on text styling, type hierarchy, readable interfaces, or when the user asks to apply Material Design 3 typography guidelines.
21material-design-3-layout
Applies Material Design 3 Expressive layout, spacing, and size hierarchy principles including grid systems, responsive design, and elevation. Use this when working on page layouts, spacing, grids, responsive design, or when the user asks to apply Material Design 3 layout guidelines.
20material-design-3-motion
Applies Material Design 3 Expressive motion and animation principles to create natural, intuitive, and engaging user experiences. Use this when implementing animations, transitions, micro-interactions, or when the user asks to apply Material Design 3 motion guidelines.
17material-design-3-color
Applies Material Design 3 Expressive dynamic color and theming principles to user interfaces. Use this when working on color palettes, themes, dynamic color systems, accessibility, or when the user asks to apply Material Design 3 color guidelines to a design or application.
16