md-chip 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 compact, contextual option — always part of a set. Four semantic variants (assist / filter / input / suggestion), three appearances, semantic colour roles, optional selection and optional removal. M3 is explicit that a lone chip is a design error: if there is only one, you wanted a 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-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter">Filter</md-chip>
<md-chip variant="filter" selected>Selected filter</md-chip>
<md-chip variant="input">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip variant="assist" icon="event">Assist</MdChip>
<MdChip variant="filter">Filter</MdChip>
<MdChip variant="filter" selected>Selected filter</MdChip>
<MdChip variant="input">Input</MdChip>
<MdChip variant="suggestion">Suggestion</MdChip>
</>
);
}// 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-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter">Filter</md-chip>
<md-chip variant="filter" selected>Selected filter</md-chip>
<md-chip variant="input">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter">Filter</md-chip>
<md-chip variant="filter" selected>Selected filter</md-chip>
<md-chip variant="input">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter">Filter</md-chip>
<md-chip variant="filter" selected>Selected filter</md-chip>
<md-chip variant="input">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip>
Already installed? See the
Installation guide for one-time package setup
(core + tokens, fonts). Each tab below shows two patterns for using
md-chip 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-chip) ─── -->
<script type="module">
import '@awc-ui/core/components/md-chip';
</script>
<md-chip>Chip</md-chip>// ─── 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 { MdChip } from '@awc-ui/react';
export function Example() {
return <MdChip>Chip</MdChip>;
}
// ─── Option B: single import (tree-shake to only md-chip) ───
// 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-chip';
export function ExampleTreeShaken() {
return <md-chip>Chip</md-chip>;
}// ─── 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-chip>Chip</md-chip>`,
})
export class ExampleComponent {}
// ─── Option B: typed directive (tree-shake friendly) ───
// Pair with `import '@awc-ui/core/components/md-chip'` in main.ts.
import { Component } from '@angular/core';
import { MdChip } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [MdChip],
template: `<md-chip>Chip</md-chip>`,
})
export class ExampleTreeShakenComponent {}<!-- ─── Option A: typed Vue wrapper (registers all components) ─── -->
<script setup lang="ts">
import { MdChip } from '@awc-ui/vue';
</script>
<template>
<MdChip>Chip</MdChip>
</template>
<!-- ─── Option B: single import (tree-shake to only md-chip) ─── -->
<script setup lang="ts">
import '@awc-ui/core/components/md-chip';
</script>
<template>
<md-chip>Chip</md-chip>
</template><!-- ─── Option A: global registration (done once in main entry) ─── -->
<!-- main.ts: -->
<!-- import { defineCustomElements } from '@awc-ui/svelte'; -->
<!-- defineCustomElements(window); -->
<md-chip>Chip</md-chip>
<!-- ─── Option B: single import (tree-shake to only md-chip) ─── -->
<script lang="ts">
import '@awc-ui/core/components/md-chip';
</script>
<md-chip>Chip</md-chip>variant="filter").variant="input").variant="suggestion").variant="assist").| Situation | Use instead |
|---|---|
| The primary or final action in a task | md-button |
| Moving to the next or previous step | md-button |
| A single standalone option | Nothing — M3: chips must appear in a set |
| Exclusive choice among 2–5 visible options | md-segmented-button |
| A long list of selectable values | md-multi-select |
| A status label that isn’t interactive | md-badge / md-status-dot |
| Navigation | md-tabs / md-navigation-bar |
| A filter with only one possible value | Nothing — M3: filter chips need more than one option |
| Need | Setting |
|---|---|
| Contextual action next to content | variant="assist" |
| Toggle a filter on or off | variant="filter" |
| A user-entered token you can delete | variant="input" |
| A dynamically offered option | variant="suggestion" |
| Raised off a busy background | appearance="elevated" |
| Status meaning (success, warning…) | color |
| Unavailable but still discoverable | soft-disabled |
| Shorter chips | density="-1…-4" |
variant selects the M3 chip type. It also decides the default behaviour of
selectable and removable — see below.
| Variant | Purpose | Typically |
|---|---|---|
assist | Default. A contextual action tied to nearby content | Leading icon, not selectable |
filter | Toggle a filter on or off | Selectable, shows a checkmark |
input | A value the user entered | Removable |
suggestion | A recommendation to accept | Not selectable |
<!-- 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-chip variant="assist" icon="directions">Directions</md-chip>
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="input">alice@example.com</md-chip>
<md-chip variant="suggestion">Add a caption</md-chip>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip variant="assist" icon="directions">Directions</MdChip>
<MdChip variant="filter">Unread</MdChip>
<MdChip variant="input">alice@example.com</MdChip>
<MdChip variant="suggestion">Add a caption</MdChip>
</>
);
}// 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-chip variant="assist" icon="directions">Directions</md-chip>
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="input">alice@example.com</md-chip>
<md-chip variant="suggestion">Add a caption</md-chip><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-chip variant="assist" icon="directions">Directions</md-chip>
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="input">alice@example.com</md-chip>
<md-chip variant="suggestion">Add a caption</md-chip>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-chip variant="assist" icon="directions">Directions</md-chip>
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="input">alice@example.com</md-chip>
<md-chip variant="suggestion">Add a caption</md-chip>selectable and removable are tri-stateBoth props are boolean | undefined and default to undefined, not
false. Left unset they are derived from variant — filter chips select,
input chips remove. Set them explicitly only to override that default, for
instance selectable="false" on an input chip that is purely a token, so
clicking the body doesn’t flash a misleading “active” state.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-chip variant="filter">Selectable by default</md-chip>
<md-chip variant="input">Removable by default</md-chip>
<md-chip variant="input" selectable="false">Token — remove only</md-chip>
<md-chip variant="input" removable="false">Opted out of removal</md-chip>
<md-chip variant="assist" selectable>Explicitly selectable</md-chip>
<md-chip variant="suggestion" removable>Explicitly removable</md-chip>import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip variant="filter">Selectable by default</MdChip>
<MdChip variant="input">Removable by default</MdChip>
<MdChip variant="input" selectable="false">Token — remove only</MdChip>
<MdChip variant="input" removable="false">Opted out of removal</MdChip>
<MdChip variant="assist" selectable>Explicitly selectable</MdChip>
<MdChip variant="suggestion" removable>Explicitly removable</MdChip>
</>
);
}// 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-chip variant="filter">Selectable by default</md-chip>
<md-chip variant="input">Removable by default</md-chip>
<md-chip variant="input" selectable="false">Token — remove only</md-chip>
<md-chip variant="input" removable="false">Opted out of removal</md-chip>
<md-chip variant="assist" selectable>Explicitly selectable</md-chip>
<md-chip variant="suggestion" removable>Explicitly removable</md-chip><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-chip variant="filter">Selectable by default</md-chip>
<md-chip variant="input">Removable by default</md-chip>
<md-chip variant="input" selectable="false">Token — remove only</md-chip>
<md-chip variant="input" removable="false">Opted out of removal</md-chip>
<md-chip variant="assist" selectable>Explicitly selectable</md-chip>
<md-chip variant="suggestion" removable>Explicitly removable</md-chip>
</template><script>
import '@awc-ui/core/define';
</script>
<md-chip variant="filter">Selectable by default</md-chip>
<md-chip variant="input">Removable by default</md-chip>
<md-chip variant="input" selectable="false">Token — remove only</md-chip>
<md-chip variant="input" removable="false">Opted out of removal</md-chip>
<md-chip variant="assist" selectable>Explicitly selectable</md-chip>
<md-chip variant="suggestion" removable>Explicitly removable</md-chip>appearance is the surface style and is independent of variant — any
chip type can be outlined, filled or elevated. color tints it.
| Need | Setting |
|---|---|
| Standard look on a normal background | appearance="outlined" (default) |
| More weight | appearance="filled" |
| Sitting on an image | appearance="elevated" |
| Semantic tone | color="primary|secondary|tertiary|error|success|warning|info" |
<!-- 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-chip appearance="outlined" icon="event">Outlined</md-chip>
<md-chip appearance="filled" icon="event">Filled</md-chip>
<md-chip appearance="elevated" icon="event">Elevated</md-chip>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip appearance="outlined" icon="event">Outlined</MdChip>
<MdChip appearance="filled" icon="event">Filled</MdChip>
<MdChip appearance="elevated" icon="event">Elevated</MdChip>
</>
);
}// 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-chip appearance="outlined" icon="event">Outlined</md-chip>
<md-chip appearance="filled" icon="event">Filled</md-chip>
<md-chip appearance="elevated" icon="event">Elevated</md-chip><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-chip appearance="outlined" icon="event">Outlined</md-chip>
<md-chip appearance="filled" icon="event">Filled</md-chip>
<md-chip appearance="elevated" icon="event">Elevated</md-chip>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-chip appearance="outlined" icon="event">Outlined</md-chip>
<md-chip appearance="filled" icon="event">Filled</md-chip>
<md-chip appearance="elevated" icon="event">Elevated</md-chip>color resolves <name> to the --md-sys-color-<name> token family at
runtime, so it accepts any role your theme defines, not just the listed
union — color="brand" works as soon as the theme ships those tokens, and an
undefined name degrades to the neutral treatment rather than rendering broken.
Only the named roles above are contrast-verified.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-chip appearance="filled" color="primary">Primary</md-chip>
<md-chip appearance="filled" color="secondary">Secondary</md-chip>
<md-chip appearance="filled" color="tertiary">Tertiary</md-chip>
<md-chip appearance="filled" color="error">Overdue</md-chip>
<md-chip appearance="filled" color="success">Paid</md-chip>
<md-chip appearance="filled" color="warning">Expiring</md-chip>
<md-chip appearance="filled" color="info">Beta</md-chip>
<md-chip appearance="outlined" color="error">Outlined error</md-chip>import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip appearance="filled" color="primary">Primary</MdChip>
<MdChip appearance="filled" color="secondary">Secondary</MdChip>
<MdChip appearance="filled" color="tertiary">Tertiary</MdChip>
<MdChip appearance="filled" color="error">Overdue</MdChip>
<MdChip appearance="filled" color="success">Paid</MdChip>
<MdChip appearance="filled" color="warning">Expiring</MdChip>
<MdChip appearance="filled" color="info">Beta</MdChip>
<MdChip appearance="outlined" color="error">Outlined error</MdChip>
</>
);
}// 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-chip appearance="filled" color="primary">Primary</md-chip>
<md-chip appearance="filled" color="secondary">Secondary</md-chip>
<md-chip appearance="filled" color="tertiary">Tertiary</md-chip>
<md-chip appearance="filled" color="error">Overdue</md-chip>
<md-chip appearance="filled" color="success">Paid</md-chip>
<md-chip appearance="filled" color="warning">Expiring</md-chip>
<md-chip appearance="filled" color="info">Beta</md-chip>
<md-chip appearance="outlined" color="error">Outlined error</md-chip><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-chip appearance="filled" color="primary">Primary</md-chip>
<md-chip appearance="filled" color="secondary">Secondary</md-chip>
<md-chip appearance="filled" color="tertiary">Tertiary</md-chip>
<md-chip appearance="filled" color="error">Overdue</md-chip>
<md-chip appearance="filled" color="success">Paid</md-chip>
<md-chip appearance="filled" color="warning">Expiring</md-chip>
<md-chip appearance="filled" color="info">Beta</md-chip>
<md-chip appearance="outlined" color="error">Outlined error</md-chip>
</template><script>
import '@awc-ui/core/define';
</script>
<md-chip appearance="filled" color="primary">Primary</md-chip>
<md-chip appearance="filled" color="secondary">Secondary</md-chip>
<md-chip appearance="filled" color="tertiary">Tertiary</md-chip>
<md-chip appearance="filled" color="error">Overdue</md-chip>
<md-chip appearance="filled" color="success">Paid</md-chip>
<md-chip appearance="filled" color="warning">Expiring</md-chip>
<md-chip appearance="filled" color="info">Beta</md-chip>
<md-chip appearance="outlined" color="error">Outlined error</md-chip>A leading icon comes from the icon prop or the leading-icon slot; the slot
wins, and takes any glyph — SVG, an icon font, an emoji. trailing-icon and
its matching slot cover the trailing side.
<!-- 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-chip icon="search">Search</md-chip>
<md-chip variant="filter" icon="check_circle" selected>Verified</md-chip>
<md-chip variant="input" icon="person">Contact</md-chip>
<md-chip>
<svg slot="leading-icon" viewBox="0 0 24 24" width="18" height="18" 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>
Slotted SVG
</md-chip>
<md-chip>
<span slot="leading-icon">🚀</span>
Slotted emoji
</md-chip>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip icon="search">Search</MdChip>
<MdChip variant="filter" icon="check_circle" selected>Verified</MdChip>
<MdChip variant="input" icon="person">Contact</MdChip>
<MdChip>
<svg slot="leading-icon" viewBox="0 0 24 24" width="18" height="18" 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>
Slotted SVG
</MdChip>
<MdChip>
<span slot="leading-icon">🚀</span>
Slotted emoji
</MdChip>
</>
);
}// 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-chip icon="search">Search</md-chip>
<md-chip variant="filter" icon="check_circle" selected>Verified</md-chip>
<md-chip variant="input" icon="person">Contact</md-chip>
<md-chip>
<svg slot="leading-icon" viewBox="0 0 24 24" width="18" height="18" 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>
Slotted SVG
</md-chip>
<md-chip>
<span slot="leading-icon">🚀</span>
Slotted emoji
</md-chip><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-chip icon="search">Search</md-chip>
<md-chip variant="filter" icon="check_circle" selected>Verified</md-chip>
<md-chip variant="input" icon="person">Contact</md-chip>
<md-chip>
<svg slot="leading-icon" viewBox="0 0 24 24" width="18" height="18" 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>
Slotted SVG
</md-chip>
<md-chip>
<span slot="leading-icon">🚀</span>
Slotted emoji
</md-chip>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-chip icon="search">Search</md-chip>
<md-chip variant="filter" icon="check_circle" selected>Verified</md-chip>
<md-chip variant="input" icon="person">Contact</md-chip>
<md-chip>
<svg slot="leading-icon" viewBox="0 0 24 24" width="18" height="18" 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>
Slotted SVG
</md-chip>
<md-chip>
<span slot="leading-icon">🚀</span>
Slotted emoji
</md-chip><!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-chip variant="filter">Enabled</md-chip>
<md-chip variant="filter" selected>Selected</md-chip>
<md-chip variant="filter" disabled>Disabled</md-chip>
<md-chip variant="filter" disabled selected>Disabled selected</md-chip>
<md-chip variant="filter" soft-disabled>Soft-disabled</md-chip>import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip variant="filter">Enabled</MdChip>
<MdChip variant="filter" selected>Selected</MdChip>
<MdChip variant="filter" disabled>Disabled</MdChip>
<MdChip variant="filter" disabled selected>Disabled selected</MdChip>
<MdChip variant="filter" soft-disabled>Soft-disabled</MdChip>
</>
);
}// 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-chip variant="filter">Enabled</md-chip>
<md-chip variant="filter" selected>Selected</md-chip>
<md-chip variant="filter" disabled>Disabled</md-chip>
<md-chip variant="filter" disabled selected>Disabled selected</md-chip>
<md-chip variant="filter" soft-disabled>Soft-disabled</md-chip><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-chip variant="filter">Enabled</md-chip>
<md-chip variant="filter" selected>Selected</md-chip>
<md-chip variant="filter" disabled>Disabled</md-chip>
<md-chip variant="filter" disabled selected>Disabled selected</md-chip>
<md-chip variant="filter" soft-disabled>Soft-disabled</md-chip>
</template><script>
import '@awc-ui/core/define';
</script>
<md-chip variant="filter">Enabled</md-chip>
<md-chip variant="filter" selected>Selected</md-chip>
<md-chip variant="filter" disabled>Disabled</md-chip>
<md-chip variant="filter" disabled selected>Disabled selected</md-chip>
<md-chip variant="filter" soft-disabled>Soft-disabled</md-chip>disabled leaves the tab order. soft-disabled keeps the same visuals but
stays focusable, so an unavailable filter is still discoverable.
A set needs a container with role="group" and an aria-label describing what
it filters. Selection is conveyed by a checkmark as well as by colour, so it
survives a colour-blind reader. The chip does not manage the set — wrapping,
scrolling and overflow are yours.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Message filters" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="filter" selected>Starred</md-chip>
<md-chip variant="filter">Has attachment</md-chip>
<md-chip variant="filter">Muted</md-chip>
</div>import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<div role="group" aria-label="Message filters" style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<MdChip variant="filter">Unread</MdChip>
<MdChip variant="filter" selected>Starred</MdChip>
<MdChip variant="filter">Has attachment</MdChip>
<MdChip variant="filter">Muted</MdChip>
</div>
</>
);
}// 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 role="group" aria-label="Message filters" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="filter" selected>Starred</md-chip>
<md-chip variant="filter">Has attachment</md-chip>
<md-chip variant="filter">Muted</md-chip>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div role="group" aria-label="Message filters" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="filter" selected>Starred</md-chip>
<md-chip variant="filter">Has attachment</md-chip>
<md-chip variant="filter">Muted</md-chip>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Message filters" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="filter">Unread</md-chip>
<md-chip variant="filter" selected>Starred</md-chip>
<md-chip variant="filter">Has attachment</md-chip>
<md-chip variant="filter">Muted</md-chip>
</div>For a set that outgrows its row, M3 prefers horizontal scrolling over wrapping into a wall of chips:
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Cuisine filters" style="display: flex; gap: 8px; overflow-x: auto; inline-size: 100%; padding-block-end: 8px;">
<md-chip variant="filter" style="flex: none;">Italian</md-chip>
<md-chip variant="filter" style="flex: none;">Japanese</md-chip>
<md-chip variant="filter" style="flex: none;">Mexican</md-chip>
<md-chip variant="filter" style="flex: none;">Thai</md-chip>
<md-chip variant="filter" style="flex: none;">Ethiopian</md-chip>
<md-chip variant="filter" style="flex: none;">Vietnamese</md-chip>
<md-chip variant="filter" style="flex: none;">Lebanese</md-chip>
<md-chip variant="filter" style="flex: none;">Peruvian</md-chip>
</div>import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<div role="group" aria-label="Cuisine filters" style={{ display: 'flex', gap: '8px', overflowX: 'auto', inlineSize: '100%', paddingBlockEnd: '8px' }}>
<MdChip variant="filter" style={{ flex: 'none' }}>Italian</MdChip>
<MdChip variant="filter" style={{ flex: 'none' }}>Japanese</MdChip>
<MdChip variant="filter" style={{ flex: 'none' }}>Mexican</MdChip>
<MdChip variant="filter" style={{ flex: 'none' }}>Thai</MdChip>
<MdChip variant="filter" style={{ flex: 'none' }}>Ethiopian</MdChip>
<MdChip variant="filter" style={{ flex: 'none' }}>Vietnamese</MdChip>
<MdChip variant="filter" style={{ flex: 'none' }}>Lebanese</MdChip>
<MdChip variant="filter" style={{ flex: 'none' }}>Peruvian</MdChip>
</div>
</>
);
}// 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 role="group" aria-label="Cuisine filters" style="display: flex; gap: 8px; overflow-x: auto; inline-size: 100%; padding-block-end: 8px;">
<md-chip variant="filter" style="flex: none;">Italian</md-chip>
<md-chip variant="filter" style="flex: none;">Japanese</md-chip>
<md-chip variant="filter" style="flex: none;">Mexican</md-chip>
<md-chip variant="filter" style="flex: none;">Thai</md-chip>
<md-chip variant="filter" style="flex: none;">Ethiopian</md-chip>
<md-chip variant="filter" style="flex: none;">Vietnamese</md-chip>
<md-chip variant="filter" style="flex: none;">Lebanese</md-chip>
<md-chip variant="filter" style="flex: none;">Peruvian</md-chip>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div role="group" aria-label="Cuisine filters" style="display: flex; gap: 8px; overflow-x: auto; inline-size: 100%; padding-block-end: 8px;">
<md-chip variant="filter" style="flex: none;">Italian</md-chip>
<md-chip variant="filter" style="flex: none;">Japanese</md-chip>
<md-chip variant="filter" style="flex: none;">Mexican</md-chip>
<md-chip variant="filter" style="flex: none;">Thai</md-chip>
<md-chip variant="filter" style="flex: none;">Ethiopian</md-chip>
<md-chip variant="filter" style="flex: none;">Vietnamese</md-chip>
<md-chip variant="filter" style="flex: none;">Lebanese</md-chip>
<md-chip variant="filter" style="flex: none;">Peruvian</md-chip>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Cuisine filters" style="display: flex; gap: 8px; overflow-x: auto; inline-size: 100%; padding-block-end: 8px;">
<md-chip variant="filter" style="flex: none;">Italian</md-chip>
<md-chip variant="filter" style="flex: none;">Japanese</md-chip>
<md-chip variant="filter" style="flex: none;">Mexican</md-chip>
<md-chip variant="filter" style="flex: none;">Thai</md-chip>
<md-chip variant="filter" style="flex: none;">Ethiopian</md-chip>
<md-chip variant="filter" style="flex: none;">Vietnamese</md-chip>
<md-chip variant="filter" style="flex: none;">Lebanese</md-chip>
<md-chip variant="filter" style="flex: none;">Peruvian</md-chip>
</div>mdRemove is a request, not the removal. The chip stays in the DOM until
you take it out. The event is cancelable, so preventDefault() lets you insert
a confirmation step.
<!-- 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 role="group" aria-label="Recipients" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="input" icon="person">alice@example.com</md-chip>
<md-chip variant="input" icon="person">bob@example.com</md-chip>
<md-chip variant="input" icon="person">carol@example.com</md-chip>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<div role="group" aria-label="Recipients" style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<MdChip variant="input" icon="person">alice@example.com</MdChip>
<MdChip variant="input" icon="person">bob@example.com</MdChip>
<MdChip variant="input" icon="person">carol@example.com</MdChip>
</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 role="group" aria-label="Recipients" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="input" icon="person">alice@example.com</md-chip>
<md-chip variant="input" icon="person">bob@example.com</md-chip>
<md-chip variant="input" icon="person">carol@example.com</md-chip>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div role="group" aria-label="Recipients" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="input" icon="person">alice@example.com</md-chip>
<md-chip variant="input" icon="person">bob@example.com</md-chip>
<md-chip variant="input" icon="person">carol@example.com</md-chip>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Recipients" style="display: flex; gap: 8px; flex-wrap: wrap;">
<md-chip variant="input" icon="person">alice@example.com</md-chip>
<md-chip variant="input" icon="person">bob@example.com</md-chip>
<md-chip variant="input" icon="person">carol@example.com</md-chip>
</div>| Event | Cancelable | Detail | Fires |
|---|---|---|---|
mdClick | no | void | The chip body was activated |
mdSelect | no | { selected } | Selection toggled — selectable chips only |
mdRemove | yes | void | The remove affordance was used, or Delete/Backspace pressed on the chip |
Only mdRemove is cancelable. To veto a selection you set selected back on
the element; preventDefault() on mdSelect does nothing.
| Property | Attribute | Type | Default | Reflects |
|---|---|---|---|---|
variant | variant | 'assist' | 'filter' | 'input' | 'suggestion' | 'assist' | Yes |
icon | icon | string | '' | — |
trailingIcon | trailing-icon | string | '' | — |
selected | selected | boolean | false | Yes |
selectable | selectable | boolean | — | — |
appearance | appearance | 'outlined' | 'filled' | 'elevated' | 'outlined' | Yes |
color | color | | 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'warning' | 'info' | (string & {}) | — | Yes |
elevated | elevated | boolean | false | Yes |
disabled | disabled | boolean | false | Yes |
softDisabled | soft-disabled | boolean | false | Yes |
removable | removable | boolean | — | Yes |
label | label | string | '' | — |
density | density | 0 | -1 | -2 | -3 | -4 | 0 | Yes |
| Slot | Description |
|---|---|
(default) | — |
leading-icon | Custom leading icon |
trailing-icon | Custom trailing icon |
Override on the host element for per-instance theming:
| Property | Description |
|---|---|
--md-chip-container-color | Container background |
--md-chip-container-color-selected | Selected container background |
--md-chip-label-color | Label text color |
--md-chip-label-color-selected | Selected label text color |
--md-chip-icon-color | Leading/trailing icon color |
--md-chip-icon-size | Icon dimensions |
--md-chip-container-shape | Border-radius override |
--md-chip-container-height | Height override |
--md-chip-outline-color | Outline color |
--md-chip-outline-width | Outline width |
--md-chip-state-layer-color | State layer color override |
--md-chip-elevation | Box-shadow override |
Style internal elements through shadow DOM with ::part():
| Part | Description |
|---|---|
state-layer | Hover/press overlay |
outline | Border element |
primary | — |
checkmark | Filter chip checkmark |
icon | Leading icon |
label | Label text wrapper |
remove | Input chip remove button |
trailing-icon | Trailing icon |
role="group" and an aria-label describing
what the set filters or holds.disabled leaves the tab order; soft-disabled stays focusable.Delete and Backspace trigger removal from the chip itself, so a keyboard
user never has to reach the ”×”.| Key | Action |
|---|---|
Tab | Focus the chip (disabled is skipped, soft-disabled is not), then its remove affordance |
Enter / Space | Activate — toggles a filter chip’s selection |
Delete / Backspace | Fire mdRemove from the chip itself |
<!-- 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 role="group" aria-label="Applied filters" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected>Unread</md-chip>
<md-chip variant="filter">Starred</md-chip>
<md-chip variant="input" removable>ada@example.com</md-chip>
<md-chip variant="input" removable>grace@example.com</md-chip>
<md-chip variant="assist" soft-disabled icon="event">Add to calendar</md-chip>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<div role="group" aria-label="Applied filters" style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<MdChip variant="filter" selected>Unread</MdChip>
<MdChip variant="filter">Starred</MdChip>
<MdChip variant="input" removable>ada@example.com</MdChip>
<MdChip variant="input" removable>grace@example.com</MdChip>
<MdChip variant="assist" softDisabled icon="event">Add to calendar</MdChip>
</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 role="group" aria-label="Applied filters" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected>Unread</md-chip>
<md-chip variant="filter">Starred</md-chip>
<md-chip variant="input" removable>ada@example.com</md-chip>
<md-chip variant="input" removable>grace@example.com</md-chip>
<md-chip variant="assist" soft-disabled icon="event">Add to calendar</md-chip>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div role="group" aria-label="Applied filters" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected>Unread</md-chip>
<md-chip variant="filter">Starred</md-chip>
<md-chip variant="input" removable>ada@example.com</md-chip>
<md-chip variant="input" removable>grace@example.com</md-chip>
<md-chip variant="assist" soft-disabled icon="event">Add to calendar</md-chip>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Applied filters" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected>Unread</md-chip>
<md-chip variant="filter">Starred</md-chip>
<md-chip variant="input" removable>ada@example.com</md-chip>
<md-chip variant="input" removable>grace@example.com</md-chip>
<md-chip variant="assist" soft-disabled icon="event">Add to calendar</md-chip>
</div>RTL — leading and trailing icon sides mirror automatically. Directional glyphs still need swapping for their meaning to survive. See RTL.
<!-- 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:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center;">
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">Unread</md-chip>
<md-chip variant="input" removable icon="person">Ada Lovelace</md-chip>
<md-chip variant="assist" icon="event">Add to calendar</md-chip>
</div>
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">غير مقروء</md-chip>
<md-chip variant="input" removable icon="person">إيمي إلسنر</md-chip>
<md-chip variant="assist" icon="event">إضافة إلى التقويم</md-chip>
</div>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '16px', alignItems: 'center' }}>
<span style={{ inlineSize: '2.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>ltr</span>
<div dir="ltr" style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<MdChip variant="filter" selected icon="check">Unread</MdChip>
<MdChip variant="input" removable icon="person">Ada Lovelace</MdChip>
<MdChip variant="assist" icon="event">Add to calendar</MdChip>
</div>
<span style={{ inlineSize: '2.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>rtl</span>
<div dir="rtl" style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<MdChip variant="filter" selected icon="check">غير مقروء</MdChip>
<MdChip variant="input" removable icon="person">إيمي إلسنر</MdChip>
<MdChip variant="assist" icon="event">إضافة إلى التقويم</MdChip>
</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="display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center;">
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">Unread</md-chip>
<md-chip variant="input" removable icon="person">Ada Lovelace</md-chip>
<md-chip variant="assist" icon="event">Add to calendar</md-chip>
</div>
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">غير مقروء</md-chip>
<md-chip variant="input" removable icon="person">إيمي إلسنر</md-chip>
<md-chip variant="assist" icon="event">إضافة إلى التقويم</md-chip>
</div>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center;">
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">Unread</md-chip>
<md-chip variant="input" removable icon="person">Ada Lovelace</md-chip>
<md-chip variant="assist" icon="event">Add to calendar</md-chip>
</div>
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">غير مقروء</md-chip>
<md-chip variant="input" removable icon="person">إيمي إلسنر</md-chip>
<md-chip variant="assist" icon="event">إضافة إلى التقويم</md-chip>
</div>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center;">
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">Unread</md-chip>
<md-chip variant="input" removable icon="person">Ada Lovelace</md-chip>
<md-chip variant="assist" icon="event">Add to calendar</md-chip>
</div>
<span style="inline-size:2.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="filter" selected icon="check">غير مقروء</md-chip>
<md-chip variant="input" removable icon="person">إيمي إلسنر</md-chip>
<md-chip variant="assist" icon="event">إضافة إلى التقويم</md-chip>
</div>
</div>Density — density="-1…-4" reduces height and padding. See
Density.
<!-- 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:grid;grid-template-columns:auto 1fr;gap:12px 16px;align-items:center;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="0" variant="filter" selected>Unread</md-chip><md-chip density="0" variant="assist" icon="event">Calendar</md-chip><md-chip density="0" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-1" variant="filter" selected>Unread</md-chip><md-chip density="-1" variant="assist" icon="event">Calendar</md-chip><md-chip density="-1" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-2" variant="filter" selected>Unread</md-chip><md-chip density="-2" variant="assist" icon="event">Calendar</md-chip><md-chip density="-2" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-3" variant="filter" selected>Unread</md-chip><md-chip density="-3" variant="assist" icon="event">Calendar</md-chip><md-chip density="-3" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-4" variant="filter" selected>Unread</md-chip><md-chip density="-4" variant="assist" icon="event">Calendar</md-chip><md-chip density="-4" variant="input" removable>Token</md-chip></div>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '12px 16px', alignItems: 'center' }}>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>0</span>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}><MdChip density="0" variant="filter" selected>Unread</MdChip><MdChip density="0" variant="assist" icon="event">Calendar</MdChip><MdChip density="0" variant="input" removable>Token</MdChip></div>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-1</span>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}><MdChip density="-1" variant="filter" selected>Unread</MdChip><MdChip density="-1" variant="assist" icon="event">Calendar</MdChip><MdChip density="-1" variant="input" removable>Token</MdChip></div>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-2</span>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}><MdChip density="-2" variant="filter" selected>Unread</MdChip><MdChip density="-2" variant="assist" icon="event">Calendar</MdChip><MdChip density="-2" variant="input" removable>Token</MdChip></div>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-3</span>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}><MdChip density="-3" variant="filter" selected>Unread</MdChip><MdChip density="-3" variant="assist" icon="event">Calendar</MdChip><MdChip density="-3" variant="input" removable>Token</MdChip></div>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-4</span>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}><MdChip density="-4" variant="filter" selected>Unread</MdChip><MdChip density="-4" variant="assist" icon="event">Calendar</MdChip><MdChip density="-4" variant="input" removable>Token</MdChip></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="display:grid;grid-template-columns:auto 1fr;gap:12px 16px;align-items:center;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="0" variant="filter" selected>Unread</md-chip><md-chip density="0" variant="assist" icon="event">Calendar</md-chip><md-chip density="0" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-1" variant="filter" selected>Unread</md-chip><md-chip density="-1" variant="assist" icon="event">Calendar</md-chip><md-chip density="-1" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-2" variant="filter" selected>Unread</md-chip><md-chip density="-2" variant="assist" icon="event">Calendar</md-chip><md-chip density="-2" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-3" variant="filter" selected>Unread</md-chip><md-chip density="-3" variant="assist" icon="event">Calendar</md-chip><md-chip density="-3" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-4" variant="filter" selected>Unread</md-chip><md-chip density="-4" variant="assist" icon="event">Calendar</md-chip><md-chip density="-4" variant="input" removable>Token</md-chip></div>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;grid-template-columns:auto 1fr;gap:12px 16px;align-items:center;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="0" variant="filter" selected>Unread</md-chip><md-chip density="0" variant="assist" icon="event">Calendar</md-chip><md-chip density="0" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-1" variant="filter" selected>Unread</md-chip><md-chip density="-1" variant="assist" icon="event">Calendar</md-chip><md-chip density="-1" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-2" variant="filter" selected>Unread</md-chip><md-chip density="-2" variant="assist" icon="event">Calendar</md-chip><md-chip density="-2" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-3" variant="filter" selected>Unread</md-chip><md-chip density="-3" variant="assist" icon="event">Calendar</md-chip><md-chip density="-3" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-4" variant="filter" selected>Unread</md-chip><md-chip density="-4" variant="assist" icon="event">Calendar</md-chip><md-chip density="-4" variant="input" removable>Token</md-chip></div>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:12px 16px;align-items:center;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="0" variant="filter" selected>Unread</md-chip><md-chip density="0" variant="assist" icon="event">Calendar</md-chip><md-chip density="0" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-1" variant="filter" selected>Unread</md-chip><md-chip density="-1" variant="assist" icon="event">Calendar</md-chip><md-chip density="-1" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-2" variant="filter" selected>Unread</md-chip><md-chip density="-2" variant="assist" icon="event">Calendar</md-chip><md-chip density="-2" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-3" variant="filter" selected>Unread</md-chip><md-chip density="-3" variant="assist" icon="event">Calendar</md-chip><md-chip density="-3" variant="input" removable>Token</md-chip></div>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:8px;flex-wrap:wrap;"><md-chip density="-4" variant="filter" selected>Unread</md-chip><md-chip density="-4" variant="assist" icon="event">Calendar</md-chip><md-chip density="-4" variant="input" removable>Token</md-chip></div>
</div>i18n — translate label (or the slotted label content) and the remove
affordance’s accessible name. Translated labels routinely run past M3’s
~20-character guidance, so plan for scrolling or truncation before the
translations arrive.
| Custom property | Purpose | Default |
|---|---|---|
--md-chip-container-color / --md-chip-container-color-selected | Background by state | Per appearance |
--md-chip-label-color / --md-chip-label-color-selected | Label by state | Per appearance |
--md-chip-icon-color / --md-chip-icon-size | Icons | Inherits label / 18px |
--md-chip-container-shape / --md-chip-container-height | Geometry | 8px / 32px |
--md-chip-outline-color / --md-chip-outline-width | Outline | outline / 1px |
--md-chip-state-layer-color | Hover/press overlay | on-surface |
--md-chip-elevation | Box-shadow override | elevation-0 (the elevated appearance sets 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>
<md-chip appearance="filled" style="--md-chip-container-shape: 4px;">Squared off</md-chip>
<md-chip style="--md-chip-container-height: 40px; --md-chip-icon-size: 22px;" icon="event">Taller</md-chip>
<md-chip style="--md-chip-outline-color: var(--md-sys-color-primary); --md-chip-outline-width: 2px;">Heavy outline</md-chip>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdChip appearance="filled" style={{ '--md-chip-container-shape': '4px' }}>Squared off</MdChip>
<MdChip style={{ '--md-chip-container-height': '40px', '--md-chip-icon-size': '22px' }} icon="event">Taller</MdChip>
<MdChip style={{ '--md-chip-outline-color': 'var(--md-sys-color-primary)', '--md-chip-outline-width': '2px' }}>Heavy outline</MdChip>
</>
);
}// 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-chip appearance="filled" style="--md-chip-container-shape: 4px;">Squared off</md-chip>
<md-chip style="--md-chip-container-height: 40px; --md-chip-icon-size: 22px;" icon="event">Taller</md-chip>
<md-chip style="--md-chip-outline-color: var(--md-sys-color-primary); --md-chip-outline-width: 2px;">Heavy outline</md-chip><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<md-chip appearance="filled" style="--md-chip-container-shape: 4px;">Squared off</md-chip>
<md-chip style="--md-chip-container-height: 40px; --md-chip-icon-size: 22px;" icon="event">Taller</md-chip>
<md-chip style="--md-chip-outline-color: var(--md-sys-color-primary); --md-chip-outline-width: 2px;">Heavy outline</md-chip>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<md-chip appearance="filled" style="--md-chip-container-shape: 4px;">Squared off</md-chip>
<md-chip style="--md-chip-container-height: 40px; --md-chip-icon-size: 22px;" icon="event">Taller</md-chip>
<md-chip style="--md-chip-outline-color: var(--md-sys-color-primary); --md-chip-outline-width: 2px;">Heavy outline</md-chip>Every default resolves through an md-sys-color role, so a chip that sets no
custom properties follows the theme on 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="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter" selected>Filter, selected</md-chip>
<md-chip variant="input" removable icon="person">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip>
<md-chip appearance="elevated">Elevated</md-chip>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<MdChip variant="assist" icon="event">Assist</MdChip>
<MdChip variant="filter" selected>Filter, selected</MdChip>
<MdChip variant="input" removable icon="person">Input</MdChip>
<MdChip variant="suggestion">Suggestion</MdChip>
<MdChip appearance="elevated">Elevated</MdChip>
</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:8px;flex-wrap:wrap;">
<md-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter" selected>Filter, selected</md-chip>
<md-chip variant="input" removable icon="person">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip>
<md-chip appearance="elevated">Elevated</md-chip>
</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:8px;flex-wrap:wrap;">
<md-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter" selected>Filter, selected</md-chip>
<md-chip variant="input" removable icon="person">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip>
<md-chip appearance="elevated">Elevated</md-chip>
</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:8px;flex-wrap:wrap;">
<md-chip variant="assist" icon="event">Assist</md-chip>
<md-chip variant="filter" selected>Filter, selected</md-chip>
<md-chip variant="input" removable icon="person">Input</md-chip>
<md-chip variant="suggestion">Suggestion</md-chip>
<md-chip appearance="elevated">Elevated</md-chip>
</div>| Part | Element |
|---|---|
primary | The chip’s main interactive box |
outline | The border ring |
state-layer | Hover / focus / press overlay |
checkmark | The selected tick on a filter chip |
icon | Leading icon |
label | Label text |
trailing-icon | Trailing icon |
remove | The remove affordance on a removable chip |
<!-- 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>
.parts-chip::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.parts-chip::part(outline) { border-width: 2px; border-color: var(--md-sys-color-primary); }
.parts-chip::part(checkmark) { color: var(--md-sys-color-tertiary); }
.parts-chip::part(remove) { color: var(--md-sys-color-error); }
</style>
<div style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip class="parts-chip" variant="filter" selected>Selected</md-chip>
<md-chip class="parts-chip" variant="filter">Unselected</md-chip>
<md-chip class="parts-chip" variant="input" removable icon="person">Removable</md-chip>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdChip } from '@awc-ui/react';
export function Demo() {
return (
<>
<style>
.parts-chip::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.parts-chip::part(outline) { border-width: 2px; border-color: var(--md-sys-color-primary); }
.parts-chip::part(checkmark) { color: var(--md-sys-color-tertiary); }
.parts-chip::part(remove) { color: var(--md-sys-color-error); }
</style>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<MdChip className="parts-chip" variant="filter" selected>Selected</MdChip>
<MdChip className="parts-chip" variant="filter">Unselected</MdChip>
<MdChip className="parts-chip" variant="input" removable icon="person">Removable</MdChip>
</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>
.parts-chip::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.parts-chip::part(outline) { border-width: 2px; border-color: var(--md-sys-color-primary); }
.parts-chip::part(checkmark) { color: var(--md-sys-color-tertiary); }
.parts-chip::part(remove) { color: var(--md-sys-color-error); }
</style>
<div style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip class="parts-chip" variant="filter" selected>Selected</md-chip>
<md-chip class="parts-chip" variant="filter">Unselected</md-chip>
<md-chip class="parts-chip" variant="input" removable icon="person">Removable</md-chip>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<style>
.parts-chip::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.parts-chip::part(outline) { border-width: 2px; border-color: var(--md-sys-color-primary); }
.parts-chip::part(checkmark) { color: var(--md-sys-color-tertiary); }
.parts-chip::part(remove) { color: var(--md-sys-color-error); }
</style>
<div style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip class="parts-chip" variant="filter" selected>Selected</md-chip>
<md-chip class="parts-chip" variant="filter">Unselected</md-chip>
<md-chip class="parts-chip" variant="input" removable icon="person">Removable</md-chip>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<style>
.parts-chip::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.parts-chip::part(outline) { border-width: 2px; border-color: var(--md-sys-color-primary); }
.parts-chip::part(checkmark) { color: var(--md-sys-color-tertiary); }
.parts-chip::part(remove) { color: var(--md-sys-color-error); }
</style>
<div style="display:flex;gap:8px;flex-wrap:wrap;">
<md-chip class="parts-chip" variant="filter" selected>Selected</md-chip>
<md-chip class="parts-chip" variant="filter">Unselected</md-chip>
<md-chip class="parts-chip" variant="input" removable icon="person">Removable</md-chip>
</div>md-chip::part(label) { letter-spacing: 0.3px;}md-button ·
md-segmented-button ·
md-multi-select ·
md-badge ·
md-status-dot ·
md-menu ·
md-ripple
md-chipTwo 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-chip 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.