Chips

ChipListControl · ChipControl

Let users filter a view, pick tags or toggle options with compact chips.

Overview

ChipListControl is a Blazor chip list: small pills users pick to filter a view or choose tags, and remove with one click. Use it, rather than a dropdown, when the options should stay in sight, such as task-label filters or a task's review notes; @bind-SelectedIds keeps the picks and @bind-Items the removals up to date. Use ChipControl on its own for a single toggle, action or dismissible pill.

Examples

#Filter chips

Pick labels to filter the task list, and pick one again to drop it; with none picked, all six tasks show: ChoiceSelectionMode.Multiple allows several chips, Removable="false" hides the ×, and QA is disabled through its ChipItem.

  • WEB-113 Site footerFrontend
  • WEB-117 Order formFrontend
Showing 2 of 6 tasks: Frontend

#Removable tags

Add a review note, remove one with ×, and pick the ones the developer has fixed: @bind-Items tracks the list, @bind-SelectedIds the picks, and Remove fixed calls RemoveAsync from code.

WEB-117 Order form: review notes from Hermione Ranger
Review notes: 4, fixed by the developer: 1

#Single chips

Use ChipControl alone on a change request estimate: a toggle, an action with Selectable="false" and its own label markup, a discount that can be dismissed and applied again, and a disabled chip.

Change request for Green Fork Cafe: 2 extra pages, rush delivery, 10% off = $810

Documentation

ParameterTypeDefaultDescription
ItemsIReadOnlyList<ChipItem>emptyThe chips, in order. Two-way with @bind-Items: a removed chip leaves the list.
SelectedIdsIReadOnlyList<string>emptyIds of the picked chips. Two-way with @bind-SelectedIds.
SelectionChoiceSelectionModeMultipleMultiple toggles each chip; Single keeps one at most, and picking it again leaves none.
RemovablebooltrueShows a × on every chip.
AriaLabelstring"Chips"Accessible name of the group.
Enabled (base)booltrueFalse disables every chip.
Visible (base)booltrueFalse hides the list with display:none.
CssClass / Style (base)string?nullOn the list element.
Id / Title / Tag / Data / Parent (base)nullAccepted but not rendered.
(unmatched attributes)Dictionary<string,object>—Accepted but not rendered: an id or aria-* given here is dropped.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.