Filter Chips

根据数据生成的单选筛选按钮,可呈现为标签或选项卡,每个选项带计数,支持方向键导航。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 可用

用法

导入

ts
import {
  SoneFilterChipsComponent,
} from "@surface-one/angular/filter-chips";

API 参考

SoneFilterChipsComponent组件

`<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.

选择器
sone-filter-chips
导出为
soneFilterChips
输入
名称类型 默认值
options必填readonly FilterChipOption<T>[]—
value双向

The selected option's value (`[(value)]`).

T | nullnull
variantFilterChipsVariant"toggle"
size

The chip size of `variant="toggle"` (the tabs list has one size).

FilterChipsSize"sm"
ariaLabel

Names the group ("Filter by level").

string | nullnull