Chip
A compact pill that represents an attribute, a filter or a choice, and can be selected, dismissed, or both. Five variants, three sizes, an icon or avatar slot, and a BbChipSet that owns the selection for a group.
Chip or Badge?
<span>, so it is not announced as a button.
Variants
Selectable or through a BbChipSet.Sizes
Small is 24px tall, Default 32px, and Large 40px. A set's Size applies to every chip in it; a chip that declares its own wins.Icon and Avatar
Icon slot is leading content. It takes an avatar as readily as an icon, which is what a person chip needs.Dismissible
<button> with an accessible name, so it is a separate target from the chip body.
Neither OnDismiss callback removes the chip from the markup — that stays your job.
Single Selection
BbChipSet<TValue> owns the selection, so each chip only needs a Value.
In Single mode, clicking the selected chip clears it — set Required to keep one selected.
Values are matched with EqualityComparer<TValue>.Default.
Multiple Selection
Multiple mode binds through Values and hands back a new list, so the bound field is replaced rather than mutated.
Required stops the last selected chip from being cleared, but it does not create the first selection — supply one.
ShowCheckMark is off by default because the mark widens a chip as it appears, which reflows a wrapped row.
Dismissible Set
OnDismiss first, then drops the value from the selection, then raises the set's OnDismiss.
A filter therefore cannot stay selected after its chip has gone.
Display Only
SelectionMode="ChipSelectionMode.None" the set only groups and spaces its chips. Wrap="false" scrolls the row horizontally instead of wrapping it.Behaviour
Non-interactive by default. A chip renders as a plain <span> with no inner button until something makes it
interactive: Selectable, a wired SelectedChanged, a wired OnClick, or membership in a selecting set.
When it is interactive the body becomes an inner <button type="button"> carrying aria-pressed.
Inheritance from the set. Variant, Size, Dismissible and ShowCheckMark are
nullable on BbChip. A value on the chip wins, null falls back to the set, and no set falls back to the documented default.
Disabled is not nullable: a chip is disabled when either the chip or the set says so.
Values are forgiving. BbChip.Value is object?, so a set needs one TValue rather than one per chip.
A chip with no value, or a value of the wrong type, simply falls out of the selection rather than throwing.
Controlled or not. A set is controlled while its matching change callback is wired
(@bind-Value for Single, @bind-Values for Multiple). Without a binding it keeps the selection itself
and treats Value or Values as the initial state only.