Android — Material 3 JS behaviour

The four chips

M3 chips in their four roles: assist for actions, filter for multi-select with an animated checkmark, input for AI-suggested content with a remove button, suggestion for prompts.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

A gallery filtered by chips

The assist chip opens the map, the three filter chips really narrow the grid, the AI input chip removes itself, and the suggestions rewrite the caption.

Gallery

۹ عکس
Damavand · 14 shots nearby

Nothing matches this filter.

Four roles, one shape

32 px tall, 8 px corners, level-1 shadow at rest — selected filter chips rise to the secondary container and their checkmark nudges the label aside.

assist
filter
AI: summarise input
suggestion

Important props

Important props
Prop Type Default What it does
variant string 'assist' assist · filter · input · suggestion; only filter and input toggle.
elevation shadow 'level1' Unselected chips carry the subtle level-1 shadow; selected rise to level 2.
checkmark inline-size '0 → 18px' The filter’s checkmark opens by width and nudges the label across.

Snippet

<button class="m3chip">کمک: باز کردن نقشه</button>
<button class="m3chip" data-filter aria-pressed="false">
    <span class="m3chip-check">✓</span> ژانر: علمی‌تخیلی
</button>
<span class="m3chip" data-input>پیشنهاد هوش مصنوعی <button aria-label="حذف">×</button></span>
<button class="m3chip">پیشنهاد: خلاصه کن</button>

<style>
.m3chip { display: inline-flex; align-items: center; gap: 8px; block-size: 32px;
          padding-inline: 16px; border-radius: 8px; border: 1px solid #CAC4D0;
          box-shadow: 0 1px 2px #0000001f; }
.m3chip-check { display: inline-grid; inline-size: 0; overflow: hidden; transition: inline-size .2s; }
.m3chip[aria-pressed='true'] { background: #E8DEF8; border-color: transparent; }
.m3chip[aria-pressed='true'] .m3chip-check { inline-size: 18px; }
</style>