Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Tones

Pick a tone because it says something: success for a verified tag, danger for a blocking one.

The six tones
Neutral Primary Success Warning Danger Info
Show code
<app-chip>Neutral</app-chip>
<app-chip tone="Primary">Primary</app-chip>
<app-chip tone="Success">Success</app-chip>
<app-chip tone="Warning">Warning</app-chip>
<app-chip tone="Danger">Danger</app-chip>
<app-chip tone="Info">Info</app-chip>

Variants

Soft is the default, outline adds an edge, and solid is for a chip that must stand out from its row.

Soft, outline and solid
Soft Outline Solid
Show code
<app-chip tone="Primary">Soft</app-chip>
<app-chip tone="Primary" variant="Outline">Outline</app-chip>
<app-chip tone="Primary" variant="Solid">Solid</app-chip>
Every tone in every variant
Neutral Primary Success Warning Danger Info
Neutral Primary Success Warning Danger Info
Neutral Primary Success Warning Danger Info
Show code
<div class="d-grid gap-2">
    <div class="d-flex flex-wrap align-items-center gap-2">
        <app-chip variant="Soft">Neutral</app-chip>
        <app-chip tone="Primary" variant="Soft">Primary</app-chip>
        <app-chip tone="Success" variant="Soft">Success</app-chip>
        <app-chip tone="Warning" variant="Soft">Warning</app-chip>
        <app-chip tone="Danger" variant="Soft">Danger</app-chip>
        <app-chip tone="Info" variant="Soft">Info</app-chip>
    </div>
    <div class="d-flex flex-wrap align-items-center gap-2">
        <app-chip variant="Outline">Neutral</app-chip>
        <app-chip tone="Primary" variant="Outline">Primary</app-chip>
        <app-chip tone="Success" variant="Outline">Success</app-chip>
        <app-chip tone="Warning" variant="Outline">Warning</app-chip>
        <app-chip tone="Danger" variant="Outline">Danger</app-chip>
        <app-chip tone="Info" variant="Outline">Info</app-chip>
    </div>
    <div class="d-flex flex-wrap align-items-center gap-2">
        <app-chip variant="Solid">Neutral</app-chip>
        <app-chip tone="Primary" variant="Solid">Primary</app-chip>
        <app-chip tone="Success" variant="Solid">Success</app-chip>
        <app-chip tone="Warning" variant="Solid">Warning</app-chip>
        <app-chip tone="Danger" variant="Solid">Danger</app-chip>
        <app-chip tone="Info" variant="Solid">Info</app-chip>
    </div>
</div>

Leading icon

A leading glyph reinforces meaning at a glance: a tick for verified, a calendar for scheduled.

A glyph before the label
Verified Draft Scheduled
Show code
<app-chip tone="Success" leading-icon="check-circle">Verified</app-chip>
<app-chip leading-icon="pencil">Draft</app-chip>
<app-chip tone="Info" leading-icon="calendar">Scheduled</app-chip>
Leading with an avatar
Assigned
Show code
<app-chip avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect width='80' height='80' fill='%234f46e5'/%3E%3Ccircle cx='40' cy='32' r='14' fill='%23c7d2fe'/%3E%3Crect x='16' y='52' width='48' height='28' rx='14' fill='%23c7d2fe'/%3E%3C/svg%3E">Assigned</app-chip>

Removable

Give a chip a dismiss button for each value in a multi-select or each tag in a filter bar.

A row of removable tags
Each ✕ drops that tag from the set.
Lightning IEC 62305 Zone 1 Rev B
Show code
<app-chip removable="true">Lightning</app-chip>
<app-chip removable="true">IEC 62305</app-chip>
<app-chip removable="true">Zone 1</app-chip>
<app-chip removable="true">Rev B</app-chip>

Toggle chip

A clickable chip stays on or off, and carries its pressed state for screen readers.

Pressed and not pressed
Click a chip to flip it.
Show code
<app-chip clickable="true" aria-pressed="true" data-toggle-chip="true">Unapproved</app-chip>
<app-chip clickable="true" aria-pressed="false" data-toggle-chip="true">Agent</app-chip>

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.

A row of filter chips
Click a chip to choose it.
Show code
<app-chip clickable="true" count="12" selected="false" data-filter-chip="true">All</app-chip>
<app-chip clickable="true" count="7" selected="true" data-filter-chip="true">Fintech</app-chip>
<app-chip clickable="true" count="5" selected="false" data-filter-chip="true">Health</app-chip>

Sizes

Use md by default, and sm in dense rows and compact filter bars.

sm and md
Small Medium
Show code
<app-chip size="Sm" tone="Primary" leading-icon="check-circle">Small</app-chip>
<app-chip size="Md" tone="Primary" leading-icon="check-circle">Medium</app-chip>

Every option

Every value of every prop, one cell each.

label or content

label="Tag"
Tag
(content): inner content, used when there is no label
Inner content

tone

tone="neutral" (default)
Neutral
tone="primary"
Primary
tone="success"
Success
tone="warning"
Warning
tone="danger"
Danger
tone="info"
Info

variant

variant="soft" (default)
Primary
variant="outline"
Primary
variant="solid"
Primary

size

size="sm"
Small
size="md" (default)
Medium

leading icon

leading-icon="check-circle"
check-circle
leading-icon="pencil"
pencil
leading-icon="calendar"
calendar
leading-icon="star"
star
leading-icon="user"
user

avatar

avatar: an image URL
Assigned
avatar + leading-icon (avatar wins)
Assigned
avatar as a node (React only): shown here as an image URL
Custom

removable

removable="true": shows a dismiss ✕ (its click is wired by data-chip-remove)
Removable

clickable

clickable="true": the chip body becomes a button

selected

selected="true": with clickable, marks the chosen filter (aria-pressed)

count

count="7": a count shown after the label
Fintech7

disabled

disabled="false" (default)
Enabled
disabled="true": dims the chip and stops it being pressed
Disabled

remove label

remove-label: aria-label of the dismiss button, no visible effect
Alpha

class

class: extra classes on the chip, no visible effect here
Tag

content edge cases

long label: wraps inside its container
A very long chip label that needs to wrap or truncate
non-string content, generic "Remove" aria-label
Node content

Guidance

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

Do
Lightning Zone 1 Rev B

Removable chips for applied filters: the user sees exactly what is active and can clear each one.

Avoid
Lightning

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

Do
Verified

One clear tone and a reinforcing glyph: the chip reads at a glance.

Avoid
Lightning Zone 1 Rev B

Three tones on three peer filters invent meaning that isn’t there: keep peers one tone.

Keep chip text short

Do
Draft

A short label reads as a token at a glance.

Avoid
Verified, submitted, and awaiting final sign-off from the reviewer

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.

neutral primary success warning danger info
soft outline solid
sm md
(none) check-circle pencil calendar star user
Tag
React, generated from the controls
<AppChip label="Tag" onRemove={fn} />
Razor, the same props
<app-chip removable="true">Tag</app-chip>

14 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
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

PropTypeDefaultDescription
(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 pairs

Show applied filters as removable chips

Do
Lightning Zone 1 Rev B

Removable chips for applied filters: the user sees exactly what is active and can clear each one.

Avoid
Lightning

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

Do
Verified

One clear tone and a reinforcing glyph: the chip reads at a glance.

Avoid
Lightning Zone 1 Rev B

Three tones on three peer filters invent meaning that isn’t there: keep peers one tone.

Keep chip text short

Do
Draft

A short label reads as a token at a glance.

Avoid
Verified, submitted, and awaiting final sign-off from the reviewer

A sentence in a chip defeats the point: a chip is a token, not a paragraph.