Components, Navigation
Filter chips
One row of pill chips that narrows a list.
default
Filter chips are one row of pill chips that narrows a list. The selected chip is shown with a soft surface and a clear border.
When to use
Use filter chips to narrow a list. To switch screens or views, use BaseTab.
| State | Appearance |
|---|---|
| Default chip | No surface, 1px border |
| Selected chip | accent surface + 1px input border + foreground text at weight 600 |
| Hover | accent surface |
- A chip is 28 high, with 12px text at weight 500, in a pill shape.
- Chips have no reflective highlight.
- Options:
semantics(tabsorradio),wrapandflush. Each chip can have acountand anicon.
What you provide
options:{ value, label, count?, icon? }[]. The first chip is usually “All”.value,onChange,ariaLabel.
Markup
<div class="CapsuleFilter_row" role="tablist" aria-label="Conversation status">
<button type="button" role="tab" aria-selected="true" tabindex="0" class="CapsuleFilter_chip" data-active="true"><span>All</span><span class="CapsuleFilter_count">24</span></button>
<button type="button" role="tab" aria-selected="false" tabindex="-1" class="CapsuleFilter_chip"><span>In progress</span><span class="CapsuleFilter_count">3</span></button>
</div>
Don’t
- Don’t use it as a filter that selects several chips at once.
- Don’t use it to switch screens. That is BaseTab.
- Don’t fill the selected chip with ink. The fill belongs to buttons.