Loading...
Loading...
Material Symbols v3 variable icon font system. Use when adding icons to buttons, navigation, status indicators, or any UI element. Provides 2,500+ icons with fill, weight, grade, and optical size axes. Integrates with project color tokens.
npx skill4agent add matthewharwood/fantasy-phonics material-symbols-v3ux-iconographyux-accessibilityutopia-fluid-scalescss/styles/icons.css@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');/fonts/material-symbols-outlined.woff2@font-face {
font-family: 'Material Symbols Outlined';
src: url('/fonts/material-symbols-outlined.woff2') format('woff2');
font-weight: 100 700;
font-style: normal;
}<span class="icon">home</span>
<span class="icon">settings</span>
<span class="icon">favorite</span>| Class | Size | Optical Size | Use Case |
|---|---|---|---|
| 20px | 20 | Dense UI, inline text |
| 24px | 24 | Default, buttons |
| 40px | 40 | Emphasis, headers |
| 48px | 48 | Hero sections |
<span class="icon icon--sm">info</span>
<span class="icon icon--md">info</span>
<span class="icon icon--lg">info</span>
<span class="icon icon--xl">info</span>.icon-fluid {
font-size: var(--step-1);
--icon-optical-size: 24;
}| Axis | Range | Default | Purpose |
|---|---|---|---|
| 0–1 | 0 | Outlined (0) vs filled (1) |
| 100–700 | 400 | Stroke weight |
| -25–200 | 0 | Fine thickness adjustment |
| 20–48 | 24 | Optical size optimization |
<span class="icon icon--outlined">favorite</span> <!-- Outline (default) -->
<span class="icon icon--filled">favorite</span> <!-- Filled --><span class="icon icon--thin">home</span> <!-- 100 -->
<span class="icon icon--light">home</span> <!-- 300 -->
<span class="icon icon--regular">home</span> <!-- 400 (default) -->
<span class="icon icon--medium">home</span> <!-- 500 -->
<span class="icon icon--bold">home</span> <!-- 700 --><span class="icon icon--grade-low">home</span> <!-- -25: thinner on dark bg -->
<span class="icon icon--grade-normal">home</span> <!-- 0 (default) -->
<span class="icon icon--grade-high">home</span> <!-- 200: bolder emphasis -->.custom-icon {
--icon-fill: 1;
--icon-weight: 600;
--icon-grade: 0;
--icon-optical-size: 24;
}<span class="icon icon--primary">check_circle</span>
<span class="icon icon--secondary">info</span>
<span class="icon icon--disabled">block</span>.icon {
color: inherit; /* Default behavior */
}
.btn-primary .icon {
color: var(--theme-on-primary);
}.icon-success { color: var(--color-success); }
.icon-error { color: var(--color-error); }
.icon-warning { color: var(--color-warning); }<span class="icon icon--interactive">settings</span>.icon--interactive {
cursor: pointer;
transition: color 0.2s ease, transform 0.2s ease;
}
.icon--interactive:hover {
color: var(--icon-color-primary);
transform: scale(1.1);
}
.icon--interactive:active {
transform: scale(0.95);
}<button class="btn">
<span class="icon" aria-hidden="true">add</span>
<span>Add Item</span>
</button>.btn {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
}<button class="btn-icon" aria-label="Settings">
<span class="icon" aria-hidden="true">settings</span>
</button>.btn-icon {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: var(--min-touch-target);
min-height: var(--min-touch-target);
padding: var(--space-xs);
}<button class="btn">
<span>Next</span>
<span class="icon" aria-hidden="true">arrow_forward</span>
</button><button>
<span class="icon" aria-hidden="true">save</span>
Save
</button><button aria-label="Close dialog">
<span class="icon" aria-hidden="true">close</span>
</button><button class="btn-icon">
<span class="icon" aria-hidden="true">delete</span>
<span class="sr-only">Delete item</span>
</button>@media (forced-colors: active) {
.icon {
forced-color-adjust: auto;
}
}| Icon | Name | Usage |
|---|---|---|
| home | | Home/main |
| menu | | Hamburger menu |
| arrow_back | | Back navigation |
| arrow_forward | | Forward/next |
| close | | Close/dismiss |
| Icon | Name | Usage |
|---|---|---|
| add | | Create new |
| edit | | Edit/modify |
| delete | | Remove |
| save | | Save |
| search | | Search |
| Icon | Name | Usage |
|---|---|---|
| check_circle | | Success/complete |
| error | | Error state |
| warning | | Warning |
| info | | Information |
| help | | Help |
| Icon | Name | Usage |
|---|---|---|
| play_arrow | | Play |
| pause | | Pause |
| volume_up | | Sound on |
| volume_off | | Sound off |
| Icon | Name | Usage |
|---|---|---|
| settings | | Settings |
| tune | | Adjustments |
| brightness_6 | | Theme toggle |
| lock | | Locked/secure |
import { animate } from 'animejs';
// Wiggle
animate(iconEl, {
rotate: [0, -10, 10, -10, 10, 0],
duration: 300,
ease: 'easeOutQuad'
});
// Bounce
animate(iconEl, {
scale: [1, 1.2, 1],
duration: 200,
ease: 'easeOutBack'
});.icon {
transition: transform 0.15s ease;
}
.btn:hover .icon {
transform: scale(1.1);
}
.btn:active .icon {
transform: scale(0.95);
}class MIcon extends HTMLElement {
static observedAttributes = ['name', 'size', 'filled'];
connectedCallback() {
this.render();
}
attributeChangedCallback() {
this.render();
}
render() {
const name = this.getAttribute('name') || 'help';
const size = this.getAttribute('size') || 'md';
const filled = this.hasAttribute('filled');
this.innerHTML = `<span class="icon icon--${size}${filled ? ' icon--filled' : ''}" aria-hidden="true">${name}</span>`;
}
}
customElements.define('m-icon', MIcon);<m-icon name="home"></m-icon>
<m-icon name="favorite" filled size="lg"></m-icon>:root {
/* Font */
--icon-font: 'Material Symbols Outlined';
/* Sizes */
--icon-size-sm: 20px;
--icon-size-md: 24px;
--icon-size-lg: 40px;
--icon-size-xl: 48px;
/* Variable font axes */
--icon-fill: 0;
--icon-weight: 400;
--icon-grade: 0;
--icon-optical-size: 24;
/* Colors */
--icon-color: var(--color-on-surface);
--icon-color-primary: var(--color-primary);
--icon-color-secondary: var(--color-on-surface-variant);
--icon-color-disabled: var(--color-outline);
}| Old (Emoji) | New (Material Symbol) |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
css/styles/icons.css