AppChoiceChip
A selectable pill the user toggles on and off — filters, tags, and small choice sets.
<app-choice-chip name="filter" value="hv" label="HV power line" multiple="true" />A choice chip is a compact pill the user clicks to select — a filter to switch on, a tag to attach, one option among a few. It holds a selection state; it does not fire an action. <app-choice-chip> is the one way to render a selectable pill; never style a .btn to fake one.
Its look comes entirely from the shared @webority/theme, so the Razor <app-choice-chip> and the React <AppChoiceChip> render identically — a chip is a chip on every Webority surface.
Playground
Every attribute, live. Each change re-renders the real tag helper on the server, so the markup underneath is the exact call that produced the chip above it.
checked the control is set to; there's no client script flipping it. See Selectable pill below for how a real page groups these into a submittable form.Selectable pill
A single chip toggles between selected and unselected. The checked state drives the look; the native input owns it.
Show code
<app-choice-chip name="line" value="hv" label="High-voltage line" multiple="true" />
<app-choice-chip> is something the user toggles. A pill that merely displays a chosen value — or that the user removes with an ✕ — is an AppChip, not a choice chip.Sizes
size scales padding, gap and font together — sm for dense filter bars, lg for a prominent choice. md is the default.
Show code
<app-choice-chip name="sz" value="s" label="Small" size="sm" checked="true" /> <app-choice-chip name="sz" value="m" label="Medium" size="md" checked="true" /> <app-choice-chip name="sz" value="l" label="Large" size="lg" checked="true" />
Multi-select
Render a chip per option and let several be active at once — the checkbox behaviour. Keep the set small and every option visible.
Show code
<app-choice-chip name="hazards" value="hv" label="HV power line" multiple="true" checked="true" /> <app-choice-chip name="hazards" value="lv" label="LV power line" multiple="true" /> <app-choice-chip name="hazards" value="tel" label="Telecom" multiple="true" />
Single-select
Pass multiple="false" and a shared name to make the chips mutually exclusive — exactly one stays selected.
Show code
<app-choice-chip name="frequency" value="daily" label="Daily" multiple="false" checked="true" /> <app-choice-chip name="frequency" value="weekly" label="Weekly" multiple="false" /> <app-choice-chip name="frequency" value="monthly" label="Monthly" multiple="false" />
AppSelect and a multi-select becomes AppMultiSelect.When to use
Use it when
- A filter the user turns on and off — narrow a list by tag, status, or type.
- Picking among a small set of options shown as pills, all visible at once.
- Multi-select tags where several choices can be active together.
Reach for something else when
- It triggers an action rather than holding a selection. → AppButton
- It only displays or removes a chosen value (a token). → AppChip
- You are picking one of many (6+) options. → AppSelect
- Each option needs an icon, title, and description. → AppChoiceCard
Best practices
Every option
The whole surface of the component, one cell per value — input type, selection state, the count badge (including the falsy-but-defined 0), and a long-label overflow case.
input type
multiple="true" — checkbox (default)multiple="false" — radioselection state
checked="false"checked="true"count — matching-row badge
(no count)count="12"count="12" + checked (badge inverts)count="0" — falsy but defined, still renderscontent
long label — overflows the pill rather than wrapping the gridclass="analytics-chip" — extra class alongside choice-chipAttributes
<label>; the Razor tag helper harvests them onto the inner <input> instead (matching AppCheck). A data-testid or id resolves to a different node on each surface.| Attribute | Type | Default | Description |
|---|---|---|---|
| name | string | — | Groups the chips. A shared name makes radio chips mutually exclusive. |
| value | string | — | The value this chip posts when selected. |
| label | string | — | The chip text — keep it short and scannable. |
| checked | bool | false | Whether the chip starts selected. |
| multiple | bool | true | Checkbox (multi-select) when true, radio when false. |
| count | string | — | A matching-row count, e.g. "Active 12". Inverts when the chip is selected. Rendered whenever set, so "0" still shows. |
| size | string | md | sm | md | lg — pill size; padding, gap and font step together. |
| class | string | — | Extra classes on the chip's label element; merges with the base choice-chip class. |
| (unclaimed attrs) | data-*, aria-*, … | — | Any other attribute lands on the <input>, not the <label> — see the callout above. |