md-icon-button spec card
Identity · when to use / when NOT · decision cues · behavioural contract · do/don't · anti-patterns · full API. Paste into your agent when you're implementing with this component.
A common, recognisable action expressed as an icon alone — close, delete, share, more. Four emphasis styles, five sizes, three container widths, and an optional toggle mode with a distinct selected glyph.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="share" aria-label="Share"></md-icon-button>
<md-icon-button variant="outlined" icon="edit" aria-label="Edit"></md-icon-button>
<md-icon-button variant="standard" icon="more_vert" aria-label="More options"></md-icon-button>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdIconButton variant="filled" icon="download" aria-label="Download"></MdIconButton>
<MdIconButton variant="tonal" icon="share" aria-label="Share"></MdIconButton>
<MdIconButton variant="outlined" icon="edit" aria-label="Edit"></MdIconButton>
<MdIconButton variant="standard" icon="more_vert" aria-label="More options"></MdIconButton>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="share" aria-label="Share"></md-icon-button>
<md-icon-button variant="outlined" icon="edit" aria-label="Edit"></md-icon-button>
<md-icon-button variant="standard" icon="more_vert" aria-label="More options"></md-icon-button><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="share" aria-label="Share"></md-icon-button>
<md-icon-button variant="outlined" icon="edit" aria-label="Edit"></md-icon-button>
<md-icon-button variant="standard" icon="more_vert" aria-label="More options"></md-icon-button>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="share" aria-label="Share"></md-icon-button>
<md-icon-button variant="outlined" icon="edit" aria-label="Edit"></md-icon-button>
<md-icon-button variant="standard" icon="more_vert" aria-label="More options"></md-icon-button>
Already installed? See the
Installation guide for one-time package setup
(core + tokens, fonts). Each tab below shows two patterns for using
md-icon-button in your project: Option A registers every AWC UI
component at once (simplest), Option B imports only this component for
tree-shake-friendly bundles.
<!-- ─── Option A: global registration (all components) ─── -->
<script type="module">
import '@awc-ui/core/define';
</script>
<!-- ─── Option B: single import (tree-shake only md-icon-button) ─── -->
<script type="module">
import '@awc-ui/core/components/md-icon-button';
</script>
<md-icon-button></md-icon-button>// ─── Option A: typed React wrapper (registers all components) ───
// Importing from '@awc-ui/react' calls defineCustomElements() as a
// side effect, so every md-* element becomes available in the browser.
import { MdIconButton } from '@awc-ui/react';
export function Example() {
return <MdIconButton></MdIconButton>;
}
// ─── Option B: single import (tree-shake to only md-icon-button) ───
// Skip the wrapper and use the raw custom element. Smallest bundle,
// but you lose typed props/events on JSX.
import '@awc-ui/core/components/md-icon-button';
export function ExampleTreeShaken() {
return <md-icon-button></md-icon-button>;
}// ─── Option A: schema module (any md-* element accepted) ───
// Pair with `defineCustomElements(window)` in main.ts.
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `<md-icon-button></md-icon-button>`,
})
export class ExampleComponent {}
// ─── Option B: typed directive (tree-shake friendly) ───
// Pair with `import '@awc-ui/core/components/md-icon-button'` in main.ts.
import { Component } from '@angular/core';
import { MdIconButton } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [MdIconButton],
template: `<md-icon-button></md-icon-button>`,
})
export class ExampleTreeShakenComponent {}<!-- ─── Option A: typed Vue wrapper (registers all components) ─── -->
<script setup lang="ts">
import { MdIconButton } from '@awc-ui/vue';
</script>
<template>
<MdIconButton></MdIconButton>
</template>
<!-- ─── Option B: single import (tree-shake to only md-icon-button) ─── -->
<script setup lang="ts">
import '@awc-ui/core/components/md-icon-button';
</script>
<template>
<md-icon-button></md-icon-button>
</template><!-- ─── Option A: global registration (done once in main entry) ─── -->
<!-- main.ts: -->
<!-- import { defineCustomElements } from '@awc-ui/svelte'; -->
<!-- defineCustomElements(window); -->
<md-icon-button></md-icon-button>
<!-- ─── Option B: single import (tree-shake to only md-icon-button) ─── -->
<script lang="ts">
import '@awc-ui/core/components/md-icon-button';
</script>
<md-icon-button></md-icon-button>| Situation | Use instead |
|---|---|
| The action needs a text label to be understood | md-button |
| The single most prominent action on the screen | md-fab |
An action with no selected state, given toggle | Plain icon button — M3 warns against this |
| Filtering, attributes, removable entries | md-chip |
| Choosing between 2–5 exclusive options | md-segmented-button |
| Navigating between destinations | md-navigation-bar |
Emphasis, highest first. M3: use filled, tonal or outlined when the
button needs visual separation from its background; standard has no
container until you interact with it.
| Variant | Emphasis | Use for |
|---|---|---|
filled | Highest | Key actions — download, delete. Use sparingly |
tonal | High-ish | A secondary action beside a high-emphasis one |
outlined | Medium | Not the focus of the interaction |
standard | Lowest | Default. Low emphasis, or on a colourful surface |
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="outlined" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="standard" icon="download" aria-label="Download"></md-icon-button>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdIconButton variant="filled" icon="download" aria-label="Download"></MdIconButton>
<MdIconButton variant="tonal" icon="download" aria-label="Download"></MdIconButton>
<MdIconButton variant="outlined" icon="download" aria-label="Download"></MdIconButton>
<MdIconButton variant="standard" icon="download" aria-label="Download"></MdIconButton>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="outlined" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="standard" icon="download" aria-label="Download"></md-icon-button><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="outlined" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="standard" icon="download" aria-label="Download"></md-icon-button>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="tonal" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="outlined" icon="download" aria-label="Download"></md-icon-button>
<md-icon-button variant="standard" icon="download" aria-label="Download"></md-icon-button>The default is sm, not md.
| Size | Height | Typical use |
|---|---|---|
xs | 32px | Table rows, dense toolbars |
sm | 40px | Default. App bars, cards, list rows |
md | 56px | Touch-first surfaces |
lg | 96px | Prominent standalone control |
xl | 136px | Hero / media control |
button-width — narrow, default, wide — widens the container without
changing the glyph or the height.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-icon-button size="xs" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="sm" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="md" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="lg" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button variant="outlined" button-width="wide" icon="star" aria-label="Star"></md-icon-button>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdIconButton size="xs" variant="tonal" icon="star" aria-label="Star"></MdIconButton>
<MdIconButton size="sm" variant="tonal" icon="star" aria-label="Star"></MdIconButton>
<MdIconButton size="md" variant="tonal" icon="star" aria-label="Star"></MdIconButton>
<MdIconButton size="lg" variant="tonal" icon="star" aria-label="Star"></MdIconButton>
<MdIconButton variant="outlined" buttonWidth="wide" icon="star" aria-label="Star"></MdIconButton>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<md-icon-button size="xs" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="sm" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="md" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="lg" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button variant="outlined" button-width="wide" icon="star" aria-label="Star"></md-icon-button><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-icon-button size="xs" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="sm" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="md" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="lg" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button variant="outlined" button-width="wide" icon="star" aria-label="Star"></md-icon-button>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-icon-button size="xs" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="sm" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="md" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button size="lg" variant="tonal" icon="star" aria-label="Star"></md-icon-button>
<md-icon-button variant="outlined" button-width="wide" icon="star" aria-label="Star"></md-icon-button>round (default) or square, with shape morphing on press and on toggle.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" shape="round" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="filled" shape="square" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="tonal" shape-morph="false" icon="add" aria-label="Add"></md-icon-button>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdIconButton variant="filled" shape="round" icon="add" aria-label="Add"></MdIconButton>
<MdIconButton variant="filled" shape="square" icon="add" aria-label="Add"></MdIconButton>
<MdIconButton variant="tonal" shapeMorph="false" icon="add" aria-label="Add"></MdIconButton>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<md-icon-button variant="filled" shape="round" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="filled" shape="square" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="tonal" shape-morph="false" icon="add" aria-label="Add"></md-icon-button><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-icon-button variant="filled" shape="round" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="filled" shape="square" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="tonal" shape-morph="false" icon="add" aria-label="Add"></md-icon-button>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" shape="round" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="filled" shape="square" icon="add" aria-label="Add"></md-icon-button>
<md-icon-button variant="tonal" shape-morph="false" icon="add" aria-label="Add"></md-icon-button>toggle adds a selected state and emits aria-pressed automatically. Provide
selected-icon so the glyph changes too — M3 wants an outlined icon when
unselected and a filled one when selected.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-icon-button toggle icon="favorite_border" selected-icon="favorite" aria-label="Add to favorites"></md-icon-button>
<md-icon-button toggle icon="bookmark_border" selected-icon="bookmark" variant="tonal" aria-label="Bookmark"></md-icon-button>
<md-icon-button toggle selected icon="star_border" selected-icon="star" variant="filled" aria-label="Star"></md-icon-button>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdIconButton toggle icon="favorite_border" selectedIcon="favorite" aria-label="Add to favorites"></MdIconButton>
<MdIconButton toggle icon="bookmark_border" selectedIcon="bookmark" variant="tonal" aria-label="Bookmark"></MdIconButton>
<MdIconButton toggle selected icon="star_border" selectedIcon="star" variant="filled" aria-label="Star"></MdIconButton>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<md-icon-button toggle icon="favorite_border" selected-icon="favorite" aria-label="Add to favorites"></md-icon-button>
<md-icon-button toggle icon="bookmark_border" selected-icon="bookmark" variant="tonal" aria-label="Bookmark"></md-icon-button>
<md-icon-button toggle selected icon="star_border" selected-icon="star" variant="filled" aria-label="Star"></md-icon-button><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-icon-button toggle icon="favorite_border" selected-icon="favorite" aria-label="Add to favorites"></md-icon-button>
<md-icon-button toggle icon="bookmark_border" selected-icon="bookmark" variant="tonal" aria-label="Bookmark"></md-icon-button>
<md-icon-button toggle selected icon="star_border" selected-icon="star" variant="filled" aria-label="Star"></md-icon-button>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-icon-button toggle icon="favorite_border" selected-icon="favorite" aria-label="Add to favorites"></md-icon-button>
<md-icon-button toggle icon="bookmark_border" selected-icon="bookmark" variant="tonal" aria-label="Bookmark"></md-icon-button>
<md-icon-button toggle selected icon="star_border" selected-icon="star" variant="filled" aria-label="Star"></md-icon-button><!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" icon="delete" aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" disabled aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" soft-disabled aria-label="Delete"></md-icon-button>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdIconButton variant="filled" icon="delete" aria-label="Delete"></MdIconButton>
<MdIconButton variant="filled" icon="delete" disabled aria-label="Delete"></MdIconButton>
<MdIconButton variant="filled" icon="delete" softDisabled aria-label="Delete"></MdIconButton>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<md-icon-button variant="filled" icon="delete" aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" disabled aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" soft-disabled aria-label="Delete"></md-icon-button><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-icon-button variant="filled" icon="delete" aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" disabled aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" soft-disabled aria-label="Delete"></md-icon-button>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-icon-button variant="filled" icon="delete" aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" disabled aria-label="Delete"></md-icon-button>
<md-icon-button variant="filled" icon="delete" soft-disabled aria-label="Delete"></md-icon-button>disabled leaves the tab order (tabindex="-1"); soft-disabled stays
focusable so the action remains discoverable. There is no loading prop —
that is md-button only.
| Event | Cancelable | Detail | Fires |
|---|---|---|---|
mdClick | no | { selected: boolean } | Every activation. In toggle mode selected is the already-flipped state |
press either button
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:flex;gap:16px;align-items:center;">
<md-icon-button id="ib-ev" icon="favorite" aria-label="Like"></md-icon-button>
<md-icon-button id="ib-ev2" toggle icon="star_border" selected-icon="star" aria-label="Star"></md-icon-button>
<code id="ib-ev-out" style="opacity:.75;font-size:.85rem;">press either button</code>
</div>
<script type="module">
const out = document.getElementById('ib-ev-out');
for (const id of ['ib-ev','ib-ev2']) {
document.getElementById(id).addEventListener('mdClick', (e) => {
out.textContent = id + ' → detail.selected = ' + e.detail.selected;
});
}
</script>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { useEffect, useRef } from 'react';
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
const outRef = useRef(null);
useEffect(() => {
const out = outRef.current;
for (const id of ['ib-ev','ib-ev2']) {
document.getElementById(id).addEventListener('mdClick', (e) => {
out.textContent = id + ' → detail.selected = ' + e.detail.selected;
});
}
}, []);
return (
<>
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
<MdIconButton id="ib-ev" icon="favorite" aria-label="Like"></MdIconButton>
<MdIconButton id="ib-ev2" toggle icon="star_border" selectedIcon="star" aria-label="Star"></MdIconButton>
<code id="ib-ev-out" ref={outRef} style={{ opacity: '.75', fontSize: '.85rem' }}>press either button</code>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
// app.component.ts
import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-demo',
templateUrl: './app.component.html',
})
export class DemoComponent implements AfterViewInit {
@ViewChild('out') outRef!: ElementRef;
ngAfterViewInit() {
const out = this.outRef.nativeElement;
for (const id of ['ib-ev','ib-ev2']) {
document.getElementById(id).addEventListener('mdClick', (e) => {
out.textContent = id + ' → detail.selected = ' + e.detail.selected;
});
}
}
}
<!-- app.component.html -->
<div style="display:flex;gap:16px;align-items:center;">
<md-icon-button id="ib-ev" icon="favorite" aria-label="Like"></md-icon-button>
<md-icon-button id="ib-ev2" toggle icon="star_border" selected-icon="star" aria-label="Star"></md-icon-button>
<code id="ib-ev-out" #out style="opacity:.75;font-size:.85rem;">press either button</code>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { onMounted, ref } from 'vue';
import '@awc-ui/core/define';
const outRef = ref(null);
onMounted(() => {
const out = outRef.value;
for (const id of ['ib-ev','ib-ev2']) {
document.getElementById(id).addEventListener('mdClick', (e) => {
out.textContent = id + ' → detail.selected = ' + e.detail.selected;
});
}
});
</script>
<template>
<div style="display:flex;gap:16px;align-items:center;">
<md-icon-button id="ib-ev" icon="favorite" aria-label="Like"></md-icon-button>
<md-icon-button id="ib-ev2" toggle icon="star_border" selected-icon="star" aria-label="Star"></md-icon-button>
<code id="ib-ev-out" ref="outRef" style="opacity:.75;font-size:.85rem;">press either button</code>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { onMount } from 'svelte';
import '@awc-ui/core/define';
let outRef;
onMount(() => {
const out = outRef;
for (const id of ['ib-ev','ib-ev2']) {
document.getElementById(id).addEventListener('mdClick', (e) => {
out.textContent = id + ' → detail.selected = ' + e.detail.selected;
});
}
});
</script>
<div style="display:flex;gap:16px;align-items:center;">
<md-icon-button id="ib-ev" icon="favorite" aria-label="Like"></md-icon-button>
<md-icon-button id="ib-ev2" toggle icon="star_border" selected-icon="star" aria-label="Star"></md-icon-button>
<code id="ib-ev-out" bind:this={outRef} style="opacity:.75;font-size:.85rem;">press either button</code>
</div>detail.selected is present on every mdClick, not just toggles — on a
plain icon button it is always false, so a shared handler can read it without
checking whether toggle is set.
<md-icon-button id="fav" toggle icon="favorite_border" selected-icon="favorite"
aria-label="Add to favorites"></md-icon-button>
<script type="module">
const btn = document.getElementById('fav');
btn.addEventListener('mdClick', async (e) => {
const wanted = e.detail.selected;
if (!(await persist(wanted))) btn.selected = !wanted; // revert on failure
});
</script>import { MdIconButton } from '@awc-ui/react';
import { useRef } from 'react';
export function FavoriteButton() {
const ref = useRef<HTMLElement & { selected: boolean }>(null);
return (
<MdIconButton
ref={ref}
toggle
icon="favorite_border"
selectedIcon="favorite"
aria-label="Add to favorites"
onMdClick={async (e) => {
const wanted = e.detail.selected;
if (!(await persist(wanted)) && ref.current) ref.current.selected = !wanted;
}}
/>
);
}import { Component } from '@angular/core';
@Component({
selector: 'app-favorite-button',
template: `
<md-icon-button
#btn
toggle
icon="favorite_border"
selected-icon="favorite"
aria-label="Add to favorites"
(mdClick)="onClick($event, btn)"
></md-icon-button>
`,
})
export class FavoriteButtonComponent {
async onClick(e: CustomEvent, btn: HTMLElement & { selected: boolean }) {
const wanted = e.detail.selected;
if (!(await persist(wanted))) btn.selected = !wanted;
}
}<script setup lang="ts">
import { ref } from 'vue';
const btn = ref<HTMLElement & { selected: boolean }>();
async function onClick(e: CustomEvent) {
const wanted = e.detail.selected;
if (!(await persist(wanted)) && btn.value) btn.value.selected = !wanted;
}
</script>
<template>
<md-icon-button
ref="btn"
toggle
icon="favorite_border"
selected-icon="favorite"
aria-label="Add to favorites"
@mdClick="onClick"
/>
</template><script lang="ts">
let btn: HTMLElement & { selected: boolean };
async function onClick(e: CustomEvent) {
const wanted = e.detail.selected;
if (!(await persist(wanted))) btn.selected = !wanted;
}
</script>
<md-icon-button
bind:this={btn}
toggle
icon="favorite_border"
selected-icon="favorite"
aria-label="Add to favorites"
on:mdClick={onClick}
/>(default) slot replaces the unselected icon; the selected slot replaces
the selected one.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-icon-button variant="tonal" aria-label="Starred">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
</md-icon-button>
<md-icon-button variant="outlined" aria-label="Launch">🚀</md-icon-button>import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdIconButton variant="tonal" aria-label="Starred">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
</MdIconButton>
<MdIconButton variant="outlined" aria-label="Launch">🚀</MdIconButton>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<md-icon-button variant="tonal" aria-label="Starred">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
</md-icon-button>
<md-icon-button variant="outlined" aria-label="Launch">🚀</md-icon-button><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-icon-button variant="tonal" aria-label="Starred">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
</md-icon-button>
<md-icon-button variant="outlined" aria-label="Launch">🚀</md-icon-button>
</template><script>
import '@awc-ui/core/define';
</script>
<md-icon-button variant="tonal" aria-label="Starred">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
</md-icon-button>
<md-icon-button variant="outlined" aria-label="Launch">🚀</md-icon-button><md-icon-button icon="open_in_new" href="https://example.com" target="_blank" aria-label="Open documentation"></md-icon-button><!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button href="https://m3.material.io" target="_blank" icon="open_in_new" aria-label="M3 guidelines, opens in a new tab"></md-icon-button>
<md-icon-button variant="filled" href="https://github.com" target="_blank" icon="code" aria-label="GitHub, opens in a new tab"></md-icon-button>
<md-icon-button variant="tonal" href="/components/" icon="apps" aria-label="Browse components"></md-icon-button>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
<MdIconButton href="https://m3.material.io" target="_blank" icon="open_in_new" aria-label="M3 guidelines, opens in a new tab"></MdIconButton>
<MdIconButton variant="filled" href="https://github.com" target="_blank" icon="code" aria-label="GitHub, opens in a new tab"></MdIconButton>
<MdIconButton variant="tonal" href="/components/" icon="apps" aria-label="Browse components"></MdIconButton>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button href="https://m3.material.io" target="_blank" icon="open_in_new" aria-label="M3 guidelines, opens in a new tab"></md-icon-button>
<md-icon-button variant="filled" href="https://github.com" target="_blank" icon="code" aria-label="GitHub, opens in a new tab"></md-icon-button>
<md-icon-button variant="tonal" href="/components/" icon="apps" aria-label="Browse components"></md-icon-button>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button href="https://m3.material.io" target="_blank" icon="open_in_new" aria-label="M3 guidelines, opens in a new tab"></md-icon-button>
<md-icon-button variant="filled" href="https://github.com" target="_blank" icon="code" aria-label="GitHub, opens in a new tab"></md-icon-button>
<md-icon-button variant="tonal" href="/components/" icon="apps" aria-label="Browse components"></md-icon-button>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button href="https://m3.material.io" target="_blank" icon="open_in_new" aria-label="M3 guidelines, opens in a new tab"></md-icon-button>
<md-icon-button variant="filled" href="https://github.com" target="_blank" icon="code" aria-label="GitHub, opens in a new tab"></md-icon-button>
<md-icon-button variant="tonal" href="/components/" icon="apps" aria-label="Browse components"></md-icon-button>
</div>| Property | Attribute | Type | Default | Reflects |
|---|---|---|---|---|
variant | variant | 'standard' | 'filled' | 'outlined' | 'tonal' | 'standard' | — |
size | size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'sm' | — |
shape | shape | 'round' | 'square' | 'round' | — |
buttonWidth | button-width | 'narrow' | 'default' | 'wide' | 'default' | — |
disabled | disabled | boolean | false | Yes |
softDisabled | soft-disabled | boolean | false | Yes |
toggle | toggle | boolean | false | — |
selected | selected | boolean | false | — |
shapeMorph | shape-morph | boolean | true | — |
ripple | ripple | boolean | true | — |
icon | icon | string | '' | — |
selectedIcon | selected-icon | string | '' | — |
href | href | string | '' | — |
target | target | string | '_self' | — |
connectedLeft | connected-left | boolean | false | Yes |
connectedRight | connected-right | boolean | false | Yes |
value | value | string | '' | — |
groupTabindex | group-tabindex | number | null | null | — |
density | density | 0 | -1 | -2 | -3 | -4 | 0 | Yes |
| Slot | Description |
|---|---|
(default) | — |
selected | Custom selected icon (toggle) |
Override on the host element for per-instance theming:
| Property | Description |
|---|---|
--md-icon-button-container-color | Container background |
--md-icon-button-icon-color | Icon color |
--md-icon-button-state-layer-color | State-layer ink (hover / focus / press) |
--md-icon-button-icon-size | Icon dimensions |
--md-icon-button-container-shape | Border-radius override |
--md-icon-button-outline-color | Outlined border color |
--md-icon-button-outline-width | Outlined border width |
--md-icon-button-container-width | Container width override |
--md-icon-button-container-height | Container height override |
Style internal elements through shadow DOM with ::part():
| Part | Description |
|---|---|
state-layer | State-layer overlay |
icon | Default icon wrapper |
selected-icon | Selected icon wrapper (toggle) |
aria-label is required. Localize it.aria-pressed is emitted automatically in toggle mode — don’t set it yourself.aria-haspopup (and aria-expanded where
you own the open state).md-tooltip so the meaning is discoverable
to sighted users — the tooltip is not the accessible name.size="xs" plus a deep density rung can drop
below it.An icon button is always icon-only, so it always needs a name from you. There is no visible label to fall back on:
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">named</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="delete" aria-label="Delete invoice 4021"></md-icon-button>
<md-icon-button icon="edit" aria-label="Edit invoice 4021"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">toggle</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button toggle icon="star_border" selected-icon="star" aria-label="Star this invoice"></md-icon-button>
<md-icon-button toggle selected icon="bookmark_border" selected-icon="bookmark" aria-label="Bookmark this invoice"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">states</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="share" aria-label="Share — enabled"></md-icon-button>
<md-icon-button soft-disabled icon="share" aria-label="Share — soft-disabled, still focusable"></md-icon-button>
<md-icon-button disabled icon="share" aria-label="Share — disabled, skipped"></md-icon-button>
</div>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center' }}>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>named</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
<MdIconButton icon="delete" aria-label="Delete invoice 4021"></MdIconButton>
<MdIconButton icon="edit" aria-label="Edit invoice 4021"></MdIconButton>
</div>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>toggle</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
<MdIconButton toggle icon="star_border" selectedIcon="star" aria-label="Star this invoice"></MdIconButton>
<MdIconButton toggle selected icon="bookmark_border" selectedIcon="bookmark" aria-label="Bookmark this invoice"></MdIconButton>
</div>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>states</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
<MdIconButton icon="share" aria-label="Share — enabled"></MdIconButton>
<MdIconButton softDisabled icon="share" aria-label="Share — soft-disabled, still focusable"></MdIconButton>
<MdIconButton disabled icon="share" aria-label="Share — disabled, skipped"></MdIconButton>
</div>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">named</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="delete" aria-label="Delete invoice 4021"></md-icon-button>
<md-icon-button icon="edit" aria-label="Edit invoice 4021"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">toggle</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button toggle icon="star_border" selected-icon="star" aria-label="Star this invoice"></md-icon-button>
<md-icon-button toggle selected icon="bookmark_border" selected-icon="bookmark" aria-label="Bookmark this invoice"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">states</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="share" aria-label="Share — enabled"></md-icon-button>
<md-icon-button soft-disabled icon="share" aria-label="Share — soft-disabled, still focusable"></md-icon-button>
<md-icon-button disabled icon="share" aria-label="Share — disabled, skipped"></md-icon-button>
</div>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">named</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="delete" aria-label="Delete invoice 4021"></md-icon-button>
<md-icon-button icon="edit" aria-label="Edit invoice 4021"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">toggle</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button toggle icon="star_border" selected-icon="star" aria-label="Star this invoice"></md-icon-button>
<md-icon-button toggle selected icon="bookmark_border" selected-icon="bookmark" aria-label="Bookmark this invoice"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">states</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="share" aria-label="Share — enabled"></md-icon-button>
<md-icon-button soft-disabled icon="share" aria-label="Share — soft-disabled, still focusable"></md-icon-button>
<md-icon-button disabled icon="share" aria-label="Share — disabled, skipped"></md-icon-button>
</div>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">named</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="delete" aria-label="Delete invoice 4021"></md-icon-button>
<md-icon-button icon="edit" aria-label="Edit invoice 4021"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">toggle</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button toggle icon="star_border" selected-icon="star" aria-label="Star this invoice"></md-icon-button>
<md-icon-button toggle selected icon="bookmark_border" selected-icon="bookmark" aria-label="Bookmark this invoice"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">states</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="share" aria-label="Share — enabled"></md-icon-button>
<md-icon-button soft-disabled icon="share" aria-label="Share — soft-disabled, still focusable"></md-icon-button>
<md-icon-button disabled icon="share" aria-label="Share — disabled, skipped"></md-icon-button>
</div>
</div>A toggle button exposes aria-pressed, so the name should describe the
action, not the current state: “Star this invoice”, not “Starred”. The
state is announced separately, and a name that flips with it gets read twice.
RTL — the container is symmetric, so nothing flips automatically. If the
glyph is directional (arrow_back, chevron_right, send), swap the icon
name yourself. See RTL.
Density — density="-1…-4" shrinks the container; verify the hit target.
See Density.
i18n — aria-label and any tooltip text come from your dictionary; the
component renders no text of its own.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="Next"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="More"></md-icon-button>
<md-icon-button icon="search" aria-label="Search"></md-icon-button>
<md-icon-button icon="favorite" aria-label="Like"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="التالي"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="المزيد"></md-icon-button>
<md-icon-button icon="search" aria-label="بحث"></md-icon-button>
<md-icon-button icon="favorite" aria-label="إعجاب"></md-icon-button>
</div>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center' }}>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>ltr</span>
<div dir="ltr" style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
<MdIconButton icon="arrow_forward" aria-label="Next"></MdIconButton>
<MdIconButton icon="chevron_right" aria-label="More"></MdIconButton>
<MdIconButton icon="search" aria-label="Search"></MdIconButton>
<MdIconButton icon="favorite" aria-label="Like"></MdIconButton>
</div>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>rtl</span>
<div dir="rtl" style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
<MdIconButton icon="arrow_forward" aria-label="التالي"></MdIconButton>
<MdIconButton icon="chevron_right" aria-label="المزيد"></MdIconButton>
<MdIconButton icon="search" aria-label="بحث"></MdIconButton>
<MdIconButton icon="favorite" aria-label="إعجاب"></MdIconButton>
</div>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="Next"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="More"></md-icon-button>
<md-icon-button icon="search" aria-label="Search"></md-icon-button>
<md-icon-button icon="favorite" aria-label="Like"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="التالي"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="المزيد"></md-icon-button>
<md-icon-button icon="search" aria-label="بحث"></md-icon-button>
<md-icon-button icon="favorite" aria-label="إعجاب"></md-icon-button>
</div>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="Next"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="More"></md-icon-button>
<md-icon-button icon="search" aria-label="Search"></md-icon-button>
<md-icon-button icon="favorite" aria-label="Like"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="التالي"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="المزيد"></md-icon-button>
<md-icon-button icon="search" aria-label="بحث"></md-icon-button>
<md-icon-button icon="favorite" aria-label="إعجاب"></md-icon-button>
</div>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="Next"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="More"></md-icon-button>
<md-icon-button icon="search" aria-label="Search"></md-icon-button>
<md-icon-button icon="favorite" aria-label="Like"></md-icon-button>
</div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button icon="arrow_forward" aria-label="التالي"></md-icon-button>
<md-icon-button icon="chevron_right" aria-label="المزيد"></md-icon-button>
<md-icon-button icon="search" aria-label="بحث"></md-icon-button>
<md-icon-button icon="favorite" aria-label="إعجاب"></md-icon-button>
</div>
</div><!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="0" icon="edit" aria-label="Edit at 0"></md-icon-button><md-icon-button density="0" variant="filled" icon="add" aria-label="Add at 0"></md-icon-button><md-icon-button density="0" variant="outlined" icon="share" aria-label="Share at 0"></md-icon-button><md-icon-button density="0" variant="tonal" icon="delete" aria-label="Delete at 0"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-1" icon="edit" aria-label="Edit at -1"></md-icon-button><md-icon-button density="-1" variant="filled" icon="add" aria-label="Add at -1"></md-icon-button><md-icon-button density="-1" variant="outlined" icon="share" aria-label="Share at -1"></md-icon-button><md-icon-button density="-1" variant="tonal" icon="delete" aria-label="Delete at -1"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-2" icon="edit" aria-label="Edit at -2"></md-icon-button><md-icon-button density="-2" variant="filled" icon="add" aria-label="Add at -2"></md-icon-button><md-icon-button density="-2" variant="outlined" icon="share" aria-label="Share at -2"></md-icon-button><md-icon-button density="-2" variant="tonal" icon="delete" aria-label="Delete at -2"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-3" icon="edit" aria-label="Edit at -3"></md-icon-button><md-icon-button density="-3" variant="filled" icon="add" aria-label="Add at -3"></md-icon-button><md-icon-button density="-3" variant="outlined" icon="share" aria-label="Share at -3"></md-icon-button><md-icon-button density="-3" variant="tonal" icon="delete" aria-label="Delete at -3"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-4" icon="edit" aria-label="Edit at -4"></md-icon-button><md-icon-button density="-4" variant="filled" icon="add" aria-label="Add at -4"></md-icon-button><md-icon-button density="-4" variant="outlined" icon="share" aria-label="Share at -4"></md-icon-button><md-icon-button density="-4" variant="tonal" icon="delete" aria-label="Delete at -4"></md-icon-button></div>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center' }}>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>0</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}><MdIconButton density="0" icon="edit" aria-label="Edit at 0"></MdIconButton><MdIconButton density="0" variant="filled" icon="add" aria-label="Add at 0"></MdIconButton><MdIconButton density="0" variant="outlined" icon="share" aria-label="Share at 0"></MdIconButton><MdIconButton density="0" variant="tonal" icon="delete" aria-label="Delete at 0"></MdIconButton></div>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-1</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}><MdIconButton density="-1" icon="edit" aria-label="Edit at -1"></MdIconButton><MdIconButton density="-1" variant="filled" icon="add" aria-label="Add at -1"></MdIconButton><MdIconButton density="-1" variant="outlined" icon="share" aria-label="Share at -1"></MdIconButton><MdIconButton density="-1" variant="tonal" icon="delete" aria-label="Delete at -1"></MdIconButton></div>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-2</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}><MdIconButton density="-2" icon="edit" aria-label="Edit at -2"></MdIconButton><MdIconButton density="-2" variant="filled" icon="add" aria-label="Add at -2"></MdIconButton><MdIconButton density="-2" variant="outlined" icon="share" aria-label="Share at -2"></MdIconButton><MdIconButton density="-2" variant="tonal" icon="delete" aria-label="Delete at -2"></MdIconButton></div>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-3</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}><MdIconButton density="-3" icon="edit" aria-label="Edit at -3"></MdIconButton><MdIconButton density="-3" variant="filled" icon="add" aria-label="Add at -3"></MdIconButton><MdIconButton density="-3" variant="outlined" icon="share" aria-label="Share at -3"></MdIconButton><MdIconButton density="-3" variant="tonal" icon="delete" aria-label="Delete at -3"></MdIconButton></div>
<span style={{ inlineSize: '4.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-4</span>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}><MdIconButton density="-4" icon="edit" aria-label="Edit at -4"></MdIconButton><MdIconButton density="-4" variant="filled" icon="add" aria-label="Add at -4"></MdIconButton><MdIconButton density="-4" variant="outlined" icon="share" aria-label="Share at -4"></MdIconButton><MdIconButton density="-4" variant="tonal" icon="delete" aria-label="Delete at -4"></MdIconButton></div>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="0" icon="edit" aria-label="Edit at 0"></md-icon-button><md-icon-button density="0" variant="filled" icon="add" aria-label="Add at 0"></md-icon-button><md-icon-button density="0" variant="outlined" icon="share" aria-label="Share at 0"></md-icon-button><md-icon-button density="0" variant="tonal" icon="delete" aria-label="Delete at 0"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-1" icon="edit" aria-label="Edit at -1"></md-icon-button><md-icon-button density="-1" variant="filled" icon="add" aria-label="Add at -1"></md-icon-button><md-icon-button density="-1" variant="outlined" icon="share" aria-label="Share at -1"></md-icon-button><md-icon-button density="-1" variant="tonal" icon="delete" aria-label="Delete at -1"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-2" icon="edit" aria-label="Edit at -2"></md-icon-button><md-icon-button density="-2" variant="filled" icon="add" aria-label="Add at -2"></md-icon-button><md-icon-button density="-2" variant="outlined" icon="share" aria-label="Share at -2"></md-icon-button><md-icon-button density="-2" variant="tonal" icon="delete" aria-label="Delete at -2"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-3" icon="edit" aria-label="Edit at -3"></md-icon-button><md-icon-button density="-3" variant="filled" icon="add" aria-label="Add at -3"></md-icon-button><md-icon-button density="-3" variant="outlined" icon="share" aria-label="Share at -3"></md-icon-button><md-icon-button density="-3" variant="tonal" icon="delete" aria-label="Delete at -3"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-4" icon="edit" aria-label="Edit at -4"></md-icon-button><md-icon-button density="-4" variant="filled" icon="add" aria-label="Add at -4"></md-icon-button><md-icon-button density="-4" variant="outlined" icon="share" aria-label="Share at -4"></md-icon-button><md-icon-button density="-4" variant="tonal" icon="delete" aria-label="Delete at -4"></md-icon-button></div>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="0" icon="edit" aria-label="Edit at 0"></md-icon-button><md-icon-button density="0" variant="filled" icon="add" aria-label="Add at 0"></md-icon-button><md-icon-button density="0" variant="outlined" icon="share" aria-label="Share at 0"></md-icon-button><md-icon-button density="0" variant="tonal" icon="delete" aria-label="Delete at 0"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-1" icon="edit" aria-label="Edit at -1"></md-icon-button><md-icon-button density="-1" variant="filled" icon="add" aria-label="Add at -1"></md-icon-button><md-icon-button density="-1" variant="outlined" icon="share" aria-label="Share at -1"></md-icon-button><md-icon-button density="-1" variant="tonal" icon="delete" aria-label="Delete at -1"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-2" icon="edit" aria-label="Edit at -2"></md-icon-button><md-icon-button density="-2" variant="filled" icon="add" aria-label="Add at -2"></md-icon-button><md-icon-button density="-2" variant="outlined" icon="share" aria-label="Share at -2"></md-icon-button><md-icon-button density="-2" variant="tonal" icon="delete" aria-label="Delete at -2"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-3" icon="edit" aria-label="Edit at -3"></md-icon-button><md-icon-button density="-3" variant="filled" icon="add" aria-label="Add at -3"></md-icon-button><md-icon-button density="-3" variant="outlined" icon="share" aria-label="Share at -3"></md-icon-button><md-icon-button density="-3" variant="tonal" icon="delete" aria-label="Delete at -3"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-4" icon="edit" aria-label="Edit at -4"></md-icon-button><md-icon-button density="-4" variant="filled" icon="add" aria-label="Add at -4"></md-icon-button><md-icon-button density="-4" variant="outlined" icon="share" aria-label="Share at -4"></md-icon-button><md-icon-button density="-4" variant="tonal" icon="delete" aria-label="Delete at -4"></md-icon-button></div>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size:100%;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="0" icon="edit" aria-label="Edit at 0"></md-icon-button><md-icon-button density="0" variant="filled" icon="add" aria-label="Add at 0"></md-icon-button><md-icon-button density="0" variant="outlined" icon="share" aria-label="Share at 0"></md-icon-button><md-icon-button density="0" variant="tonal" icon="delete" aria-label="Delete at 0"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-1" icon="edit" aria-label="Edit at -1"></md-icon-button><md-icon-button density="-1" variant="filled" icon="add" aria-label="Add at -1"></md-icon-button><md-icon-button density="-1" variant="outlined" icon="share" aria-label="Share at -1"></md-icon-button><md-icon-button density="-1" variant="tonal" icon="delete" aria-label="Delete at -1"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-2" icon="edit" aria-label="Edit at -2"></md-icon-button><md-icon-button density="-2" variant="filled" icon="add" aria-label="Add at -2"></md-icon-button><md-icon-button density="-2" variant="outlined" icon="share" aria-label="Share at -2"></md-icon-button><md-icon-button density="-2" variant="tonal" icon="delete" aria-label="Delete at -2"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-3" icon="edit" aria-label="Edit at -3"></md-icon-button><md-icon-button density="-3" variant="filled" icon="add" aria-label="Add at -3"></md-icon-button><md-icon-button density="-3" variant="outlined" icon="share" aria-label="Share at -3"></md-icon-button><md-icon-button density="-3" variant="tonal" icon="delete" aria-label="Delete at -3"></md-icon-button></div>
<span style="inline-size:4.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;"><md-icon-button density="-4" icon="edit" aria-label="Edit at -4"></md-icon-button><md-icon-button density="-4" variant="filled" icon="add" aria-label="Add at -4"></md-icon-button><md-icon-button density="-4" variant="outlined" icon="share" aria-label="Share at -4"></md-icon-button><md-icon-button density="-4" variant="tonal" icon="delete" aria-label="Delete at -4"></md-icon-button></div>
</div>| Custom property | Purpose |
|---|---|
--md-icon-button-container-color | Container background |
--md-icon-button-icon-color | Glyph colour |
--md-icon-button-state-layer-color | Hover/press overlay |
--md-icon-button-icon-size | Glyph size |
--md-icon-button-container-shape | Corner radius |
--md-icon-button-outline-color / -width | outlined border |
--md-icon-button-container-width / -height | Explicit container box |
CSS parts — state-layer, icon, selected-icon.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<style>
.ib-brand {
--md-icon-button-container-color: #1B5E20;
--md-icon-button-icon-color: #FFFFFF;
}
.ib-square { --md-icon-button-container-shape: 10px; }
.ib-big::part(icon) { transform: scale(1.35); }
.ib-gold::part(selected-icon) { color: #F9A825; }
</style>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button class="ib-brand" variant="filled" icon="add" aria-label="Brand colour"></md-icon-button>
<md-icon-button class="ib-square" variant="filled" icon="edit" aria-label="Square shape"></md-icon-button>
<md-icon-button class="ib-big" variant="tonal" icon="share" aria-label="Larger glyph via ::part(icon)"></md-icon-button>
<md-icon-button class="ib-gold" toggle selected icon="star_border" selected-icon="star" aria-label="Gold when selected"></md-icon-button>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdIconButton } from '@awc-ui/react';
export function Demo() {
return (
<>
<style>
.ib-brand {
--md-icon-button-container-color: #1B5E20;
--md-icon-button-icon-color: #FFFFFF;
}
.ib-square { --md-icon-button-container-shape: 10px; }
.ib-big::part(icon) { transform: scale(1.35); }
.ib-gold::part(selected-icon) { color: #F9A825; }
</style>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
<MdIconButton className="ib-brand" variant="filled" icon="add" aria-label="Brand colour"></MdIconButton>
<MdIconButton className="ib-square" variant="filled" icon="edit" aria-label="Square shape"></MdIconButton>
<MdIconButton className="ib-big" variant="tonal" icon="share" aria-label="Larger glyph via ::part(icon)"></MdIconButton>
<MdIconButton className="ib-gold" toggle selected icon="star_border" selectedIcon="star" aria-label="Gold when selected"></MdIconButton>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<style>
.ib-brand {
--md-icon-button-container-color: #1B5E20;
--md-icon-button-icon-color: #FFFFFF;
}
.ib-square { --md-icon-button-container-shape: 10px; }
.ib-big::part(icon) { transform: scale(1.35); }
.ib-gold::part(selected-icon) { color: #F9A825; }
</style>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button class="ib-brand" variant="filled" icon="add" aria-label="Brand colour"></md-icon-button>
<md-icon-button class="ib-square" variant="filled" icon="edit" aria-label="Square shape"></md-icon-button>
<md-icon-button class="ib-big" variant="tonal" icon="share" aria-label="Larger glyph via ::part(icon)"></md-icon-button>
<md-icon-button class="ib-gold" toggle selected icon="star_border" selected-icon="star" aria-label="Gold when selected"></md-icon-button>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<style>
.ib-brand {
--md-icon-button-container-color: #1B5E20;
--md-icon-button-icon-color: #FFFFFF;
}
.ib-square { --md-icon-button-container-shape: 10px; }
.ib-big::part(icon) { transform: scale(1.35); }
.ib-gold::part(selected-icon) { color: #F9A825; }
</style>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button class="ib-brand" variant="filled" icon="add" aria-label="Brand colour"></md-icon-button>
<md-icon-button class="ib-square" variant="filled" icon="edit" aria-label="Square shape"></md-icon-button>
<md-icon-button class="ib-big" variant="tonal" icon="share" aria-label="Larger glyph via ::part(icon)"></md-icon-button>
<md-icon-button class="ib-gold" toggle selected icon="star_border" selected-icon="star" aria-label="Gold when selected"></md-icon-button>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<style>
.ib-brand {
--md-icon-button-container-color: #1B5E20;
--md-icon-button-icon-color: #FFFFFF;
}
.ib-square { --md-icon-button-container-shape: 10px; }
.ib-big::part(icon) { transform: scale(1.35); }
.ib-gold::part(selected-icon) { color: #F9A825; }
</style>
<div style="display:flex;gap:12px;flex-wrap:wrap;align-items:center;">
<md-icon-button class="ib-brand" variant="filled" icon="add" aria-label="Brand colour"></md-icon-button>
<md-icon-button class="ib-square" variant="filled" icon="edit" aria-label="Square shape"></md-icon-button>
<md-icon-button class="ib-big" variant="tonal" icon="share" aria-label="Larger glyph via ::part(icon)"></md-icon-button>
<md-icon-button class="ib-gold" toggle selected icon="star_border" selected-icon="star" aria-label="Gold when selected"></md-icon-button>
</div>The three parts are state-layer, icon and selected-icon. The last one is
what makes a toggle’s two states themeable independently — the gold star above
styles only the selected glyph.
md-button ·
md-fab ·
md-button-group ·
md-chip ·
md-tooltip ·
md-menu
md-icon-buttonTwo artefacts to give your AI agent so it generates correct UI with this component. The per-component spec answers "how do I use this exact tag?". The main-llm spec answers "which tag should I pick in the first place?".
md-icon-button spec card
Identity · when to use / when NOT · decision cues · behavioural contract · do/don't · anti-patterns · full API. Paste into your agent when you're implementing with this component.
System-prompt preamble · decision matrix · token reference · page recipes · anti-patterns. Paste into the system prompt at the start of a piece of work.