ChipLabel
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays a compact status or category label with an optional icon, status dot, and close button.
- C#
- VB.NET
public class ChipLabel : Control
Public Class ChipLabel
Inherits Control
Text is plain text. Selectable enables user toggling; Selected can always be set in code. Closing raises CloseClick without removing or disposing the control. ChipSize is a visual preset, while the inherited Size specifies outer bounds. Click is available even when Selectable is false.
Example:
var chip = new ChipLabel {
Text = "Healthy", Tone = ChipTone.Success, ShowDot = true,
Closable = true, Selectable = true, Size = new Size(120, 28)
};
chip.CloseClick += (s, e) => chip.Visible = false;
Controls.Add(chip);
Constructors
ChipLabel()
Initializes a new instance of ChipLabel.
Properties
ChipSize
ChipSize: Gets or sets the spacing and font preset. The inherited Size still controls the outer bounds. (Default: Medium)
Closable
Boolean: Gets or sets whether a separate close button is displayed. (Default: False)
CloseText
String: Gets or sets the localized override for the "Close {0}" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation. {0} is the item caption. Literal braces can be written as {{ and }}.
DefaultSize
Size: Gets the default outer size of 100 by 28 pixels.
Icon
String: Gets or sets a Wisej image source, URL, or theme image name displayed before the text. (Default: "")
Pulse
Boolean: Gets or sets whether the visible status dot pulses. Reduced motion preferences disable animation. (Default: False)
Selectable
Boolean: Gets or sets whether activation toggles Selected. Click is raised in either mode. (Default: False)
This hides Control.Selectable, which controls text selection, and does not modify that property. Turning Selectable off preserves Selected. Programmatic selection remains available.
Selected
Boolean: Gets or sets the selection state, raising SelectedChanged once for each actual change. (Default: False)
Shape
ChipShape: Gets or sets the pill or rounded rectangle shape. (Default: Pill)
ShowDot
Boolean: Gets or sets whether a status dot appears before the text. (Default: False)
Text
String: Gets or sets the plain text caption. Null becomes an empty string. (Default: "")
Tone
ChipTone: Gets or sets the semantic color palette. (Default: Neutral)
Variant
ChipVariant: Gets or sets the soft, filled, or outline color treatment. (Default: Soft)
Methods
OnCloseClick(e)
Raises the CloseClick event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnSelectedChanged(e)
Raises the SelectedChanged event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnWebEvent(e)
Dispatches dedicated activation events and suppresses duplicate pointer clicks.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Serializes the presentation and wires ordinary events independently of subscriptions.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
Events
CloseClick
EventHandler Occurs when the separate close button is activated. The control remains alive and visible.
SelectedChanged
EventHandler Occurs when Selected changes through code or user interaction.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |