On this page
@addTagHelper *, Webority.Ui.RazorTones
Pick a tone because it says something: success for a verified tag, danger for a blocking one.
Variants
Soft is the default, outline adds an edge, and solid is for a chip that must stand out from its row.
Leading icon
A leading glyph reinforces meaning at a glance: a tick for verified, a calendar for scheduled.
Removable
Give a chip a dismiss button for each value in a multi-select or each tag in a filter bar.
Toggle chip
A clickable chip stays on or off, and carries its pressed state for screen readers.
Single-choice filter
A row of clickable chips where one is the chosen filter. The chosen chip carries aria-pressed and takes the primary tint; a count shows after the label.
Sizes
Use md by default, and sm in dense rows and compact filter bars.
Every option
Every value of every prop, one cell each.
label or content
label="Tag"(content): inner content, used when there is no labeltone
tone="neutral" (default)
tone="primary"
tone="success"
tone="warning"
tone="danger"
tone="info"
variant
variant="soft" (default)
variant="outline"
variant="solid"
size
size="sm"size="md" (default)leading icon
leading-icon="check-circle"
leading-icon="pencil"
leading-icon="calendar"
leading-icon="star"
leading-icon="user"
avatar
avatar: an image URLavatar + leading-icon (avatar wins)avatar as a node (React only): shown here as an image URLremovable
removable="true": shows a dismiss ✕ (its click is wired by data-chip-remove)clickable
clickable="true": the chip body becomes a buttonselected
selected="true": with clickable, marks the chosen filter (aria-pressed)count
count="7": a count shown after the labeldisabled
disabled="false" (default)disabled="true": dims the chip and stops it being pressedremove label
remove-label: aria-label of the dismiss button, no visible effectclass
class: extra classes on the chip, no visible effect herecontent edge cases
long label: wraps inside its containernon-string content, generic "Remove" aria-labelGuidance
What to do, and what to avoid.
Use it when
- A multi-select needs to show each chosen value as a removable token.
- A filter bar shows the active facets, each dismissible.
- You are labelling something with a small tag: a category, a state, a version.
Reach for something else when
- The user is picking one option from a set (a form control). → AppChoiceChip
- You are showing a small count or a bare label. → AppBadge
- You are showing a status mapped from an enum. → AppStatusBadge
- It is really a button that performs an action. → AppButton
Show applied filters as removable chips
Removable chips for applied filters: the user sees exactly what is active and can clear each one.
A disabled chip cannot be cleared, so the user has no way to remove the filter from the chip.
One clear tone and a glyph
One clear tone and a reinforcing glyph: the chip reads at a glance.
Three tones on three peer filters invent meaning that isn’t there: keep peers one tone.
Keep chip text short
A short label reads as a token at a glance.
A sentence in a chip defeats the point: a chip is a token, not a paragraph.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
14 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| tonedefault neutral | neutral | primary | success | warning | danger | info | neutral | The colour meaning: neutral by default, or a state or category. |
| variantdefault soft | soft | outline | solid | soft | Colour treatment: a tinted surface (soft, the default), a tinted surface with a coloured border (outline), or a filled pill with contrasting text (solid). |
| sizedefault md | sm | md | md | sm for a denser chip; md by default. |
| leading-icondefault - | string | - | Semantic icon name for a leading glyph. |
| labeldefault - | string | - | Chip text. Inner content is used when absent. |
Less common 9 props
| Prop | Type | Default | Description |
|---|---|---|---|
| (content)default - | string | - | The chip label (inner content). |
| avatardefault - | string | - | Leading avatar image URL. |
| removabledefault false | bool | false | When true, shows a dismiss ✕ (wire the click via data-chip-remove). |
| clickabledefault false | bool | false | Render the chip body as a button, a clickable filter chip. |
| selecteddefault - | bool | - | With clickable, true marks the chip as the chosen filter (its button carries aria-pressed). A chip that is not clickable refuses it. |
| countdefault - | int | - | A count shown after the label, such as a filter's result count. |
| remove-labeldefault - | string | - | aria-label for the dismiss button. |
| disableddefault false | bool | false | Dims the chip and stops it from being pressed. |
| classdefault - | string | - | Extra classes on the chip. |
Screen reader
3 notes- A removable chip's dismiss button is named by removeLabel, or by Remove followed by the chip text when no label is given.
- A clickable chip is a button; its aria-* and data-* attributes go to that button, so the button carries the name.
- disabled disables the chip button and the dismiss button.
Do and avoid
3 pairsShow applied filters as removable chips
Removable chips for applied filters: the user sees exactly what is active and can clear each one.
A disabled chip cannot be cleared, so the user has no way to remove the filter from the chip.
One clear tone and a glyph
One clear tone and a reinforcing glyph: the chip reads at a glance.
Three tones on three peer filters invent meaning that isn’t there: keep peers one tone.
Keep chip text short
A short label reads as a token at a glance.
A sentence in a chip defeats the point: a chip is a token, not a paragraph.