Skip to main content

ChipLabel

Wisej.NET 4.2.0+

Status chips in the soft, filled and outline variants, with dots, an icon, a selected filter and closable tags.

A ChipLabel is a small pill of text that states something about a record — "Paid", "Overdue", "High priority", "EMEA" — in one of five semantic colours. It can lead with an icon or a status dot (which can pulse for "live" states), and it can carry a close button, which makes it a removable tag or filter.

Use it where a Label with a coloured background has been doing the job by hand: status columns, ticket headers, the applied filters above a grid. A chip can also be made selectable, so a row of them works as a set of toggles.

For a group of chips managed as one control — a wrapping set of filter chips with counts and a single selection model — use the ChipGroup, documented with the SegmentedButton.

info

For a complete list of properties, methods, and events, see the API documentation.

Features​

Tone and Variant​

Tone picks the semantic colour: Neutral (the default), Primary, Success, Warning or Danger. Variant picks how strongly it is applied: Soft (a tinted background, the default), Filled (a solid background with contrasting text) or Outline (a coloured border on a plain background). Keep one variant for one meaning across an application — soft for status, outline for categories, for example — and let the tone carry the difference.

Shape and Size​

Shape is Pill (fully rounded, the default) or Rounded (a rectangle with small corners). ChipSize is Small, Medium or Large and sets the padding and font size; the control's own Size still sets its outer bounds, so size the control to the preset you choose (the default size is 100 × 28).

Icon and Status Dot​

Icon shows an image before the text, from a URL or a theme image name. ShowDot shows a small dot in the tone's colour instead, the usual mark for a live status; Pulse animates it. The animation is turned off for users whose system asks for reduced motion.

Close Button​

Closable adds a close button after the text. Clicking it raises CloseClick — and does nothing else: the chip is neither removed nor hidden, so your code decides what closing means. The button has its own keyboard focus and a localized accessible name, "Close" followed by the caption, which CloseText overrides.

Selection​

Click is raised whenever the chip is activated by pointer or keyboard. With Selectable set to true each activation also toggles Selected and raises SelectedChanged. Code can set Selected at any time, whether or not the chip is selectable.

How To​

Show the Status of a Record​

Map the record's state onto a tone once and reuse it wherever the state is shown.

static ChipTone ToneOf(InvoiceStatus status) => status switch
{
InvoiceStatus.Paid => ChipTone.Success,
InvoiceStatus.Overdue => ChipTone.Danger,
InvoiceStatus.Pending => ChipTone.Warning,
_ => ChipTone.Neutral
};

this.statusChip.Text = invoice.Status.ToString();
this.statusChip.Tone = ToneOf(invoice.Status);
this.statusChip.ShowDot = true;
this.statusChip.Pulse = invoice.Status == InvoiceStatus.Overdue;

Show Applied Filters as Removable Tags​

Add a closable chip per filter to a FlowLayoutPanel, and remove both the filter and the chip when its close button is clicked.

void AddFilterChip(string field, string value)
{
var chip = new ChipLabel
{
Text = $"{field}: {value}",
Tone = ChipTone.Primary,
Variant = ChipVariant.Outline,
ChipSize = ChipSize.Small,
Closable = true,
Size = new Size(140, 24)
};
chip.CloseClick += (s, e) =>
{
this.ordersFilter.Remove(field);
chip.Dispose();
ReloadOrders();
};
this.filterPanel.Controls.Add(chip);
}

Use Chips as Toggles​

A selectable chip toggles itself; handle SelectedChanged to react.

this.urgentChip.Selectable = true;
this.urgentChip.Tone = ChipTone.Danger;
this.urgentChip.SelectedChanged += (s, e) =>
{
this.ticketsSource.Filter = this.urgentChip.Selected ? "Priority = 'Urgent'" : null;
};

Advanced​

JavaScript Widget​

ItemDescription
Class name"wisej.web.ChipLabel"
Theme appearance"chiplabel", see Themes. The variant and tone are combined into one state, such as "soft-success" or "outline-danger".
Child components"dot" is the status dot. "icon" is the image. "label" is the caption. "close" is the close button. See JavaScript.