Filter Chips
Pulsanti di filtro a scelta singola generati dai dati, come chip o schede, con un conteggio per opzione e navigazione con le frecce.
Disponibile in
Angular: disponibile Vue: disponibile React: disponibile React Native: disponibile
Utilizzo
<div class="demo-stack">
<sone-filter-chips [options]="levels" [(value)]="level" ariaLabel="Filter by level" />
<sone-filter-chips variant="tabs" [options]="views" [(value)]="view" ariaLabel="Reminder views" />
</div>Importazione
import {
SoneFilterChipsComponent,
} from "@surface-one/angular/filter-chips";Riferimento API
SoneFilterChipsComponentComponente
`<sone-filter-chips>` — one-of-many filter buttons rendered from data, with an optional count badge per option. `variant="toggle"` is an outline Toggle Group of separate chips; `variant="tabs"` is a Tabs list. Either way each option is a toggle button (`aria-pressed`) in a labelled `role="group"` — a filter, not a tab panel — with arrow-key, Home and End navigation. `[(value)]` binds the selected option.
| Nome | Tipo | Predefinito |
|---|---|---|
optionsobbligatorio | readonly FilterChipOption<T>[] | — |
valuebidirezionaleThe selected option's value (`[(value)]`). | T | null | null |
variant | FilterChipsVariant | "toggle" |
sizeThe chip size of `variant="toggle"` (the tabs list has one size). | FilterChipsSize | "sm" |
ariaLabelNames the group ("Filter by level"). | string | null | null |