Icon
Description
The Icon component renders a visual glyph using either the strongly typed UIcons set or an Emoji. It is useful for reinforcing actions, labeling content, and improving scanability without writing raw HTML or CSS classes by hand.
Usage
Create icons through the Icon(...) helper overloads or by instantiating Icon directly. You can update the glyph later with SetIcon(...), style it with foreground color and text-formatting helpers, and add a tooltip with SetTitle(...).
API reference
public class Icon : IComponent, IHasForegroundColor, ITextFormatingA single icon glyph from the bundled UIcons set, with configurable size, weight and color.
Constructors
public Icon(UIcons icon, UIconsWeight weight = UIconsWeight.Regular, TextSize size = TextSize.Small)Initializes a new instance of this class.
Properties
public string Foreground { get ; set ; }Gets or sets the CSS color (foreground) of the component.
public TextWeight Weight { get ; set ; }Gets or sets the font weight of the component.
public TextAlign TextAlign { get ; set ; }Gets or sets the text alignment of the component.
Methods
public Icon SetIcon(Emoji icon, TextSize size = TextSize.Medium)Sets the icon of the component.
public Icon SetIcon(UIcons icon, UIconsWeight weight = UIconsWeight.Regular, TextSize size = TextSize.Small)Sets the icon of the component.
public static string Transform(UIcons icon, UIconsWeight weight)Configures the component to transform.