Badge
Description
A component to display a badge
Badges, Tags, and Chips are small visual elements used to categorize content, highlight status, or display metadata.
They come in various styles: Badges are typically static indicators, Tags are for categorization, and Chips often include interactive elements like a removal button.
API reference
public enum BadgeTonePredefined visual tones used to color the component.
public abstract class TokenBase<T> : ComponentBase<T, HTMLElement> where T : TokenBase<T>Properties
public string Text { get ; set ; }Gets or sets the text shown in the component.
public string Icon { get ; set ; }Gets or sets the icon shown by the component.
public bool IsPill { get ; set ; }Returns a value indicating whether the component is pill.
public bool IsOutline { get ; set ; }Returns a value indicating whether the component is outline.
Methods
public T Background(string color)Gets or sets the CSS background of the component.
public T Foreground(string color)Gets or sets the CSS color (foreground) of the component.
public T OnRemove(Action<T> onRemove)Registers a callback invoked when the remove event fires.
public T Removable(bool value = true)Configures the component to removable.
public sealed class Badge : TokenBase<Badge>public sealed class Tag : TokenBase<Tag>public sealed class Chip : TokenBase<Chip>Samples
Standard Badges
Tags and Chips
Tags and chips support icons, pill shapes, and interactive removal.