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

class

Icon

public class Icon : IComponent, IHasForegroundColor, ITextFormating

A single icon glyph from the bundled UIcons set, with configurable size, weight and color.

Namespace
Tesserae
Implements
IComponent, IHasForegroundColor, ITextFormating

Constructors

NameDescription
IconInitializes a new instance of this class.
Constructor
Icon
Overload
Icon()Initializes a new instance of this class.
Icon(UIcons, UIconsWeight, TextSize)Initializes a new instance of this class.
Icon(Emoji, TextSize)Initializes a new instance of this class.
Icon()
public Icon()

Initializes a new instance of this class.

Icon(UIcons, UIconsWeight, TextSize)
public Icon(UIcons icon, UIconsWeight weight = UIconsWeight.Regular, TextSize size = TextSize.Small)

Initializes a new instance of this class.

Parameters

icon UIcons
weight UIconsWeight
size TextSize
Icon(Emoji, TextSize)
public Icon(Emoji icon, TextSize size = TextSize.Medium)

Initializes a new instance of this class.

Parameters

icon Emoji
size TextSize

Properties

NameDescription
ForegroundGets or sets the CSS color (foreground) of the component.
SizeGets or sets the size of the component.
WeightGets or sets the font weight of the component.
TextAlignGets or sets the text alignment of the component.
TitleGets or sets the title of the component.
Property
Icon.Foreground
public string Foreground { get ; set ; }

Gets or sets the CSS color (foreground) of the component.

Property
Icon.Size
public TextSize Size { get ; set ; }

Gets or sets the size of the component.

Property
Icon.Weight
public TextWeight Weight { get ; set ; }

Gets or sets the font weight of the component.

Property
Icon.TextAlign
public TextAlign TextAlign { get ; set ; }

Gets or sets the text alignment of the component.

Property
Icon.Title
public string Title { get ; set ; }

Gets or sets the title of the component.

Methods

NameDescription
SetIconSets the icon of the component.
TransformConfigures the component to transform.
SetTitleSets the title of the component.
RenderRenders the component's root HTML element.
Method
Icon.SetIcon
Overload
SetIcon(Emoji, TextSize)Sets the icon of the component.
SetIcon(UIcons, UIconsWeight, TextSize)Sets the icon of the component.
SetIcon(Emoji, TextSize)
public Icon SetIcon(Emoji icon, TextSize size = TextSize.Medium)

Sets the icon of the component.

Parameters

icon Emoji
size TextSize
SetIcon(UIcons, UIconsWeight, TextSize)
public Icon SetIcon(UIcons icon, UIconsWeight weight = UIconsWeight.Regular, TextSize size = TextSize.Small)

Sets the icon of the component.

Parameters

icon UIcons
weight UIconsWeight
size TextSize
Method
Icon.Transform
public static string Transform(UIcons icon, UIconsWeight weight)

Configures the component to transform.

Method
Icon.SetTitle
public Icon SetTitle(string title)

Sets the title of the component.

Method
Icon.Render
public HTMLElement Render()

Renders the component's root HTML element.

See also

© 2026 Curiosity. All rights reserved.