Table of Contents

UI Constants

C# constants are available in UI code to avoid writing hard-coded strings. These constants ensure consistency and facilitate code maintenance by providing standardized values for colors, sizes, font weights, and message severities.

Available constant classes

StandardColorNames

The StandardColorNames class contains all standard colors available in the theme in kebab-case format.

Usage examples:

// Instead of hard-coding
string color = "primary-500";

// Use the constant
string color = StandardColorNames.Primary500;

Main available constants:

  • Background, Foreground
  • Primary50 to Primary950
  • Neutral50 to Neutral950
  • Success50 to Success950
  • Warning50 to Warning950
  • Danger50 to Danger950
  • Info50 to Info950

StandardSizes

The StandardSizes class provides standardized sizes used in the user interface.

Usage examples:

// Instead of hard-coding
string size = "medium";

// Use the constant
string size = StandardSizes.Medium;

Available constants:

  • None
  • ExtraSmall
  • Small
  • Medium
  • Large
  • ExtraLarge

FontWeights

The FontWeights class defines available font weights.

Usage examples:

// Instead of hard-coding
string weight = "strong";

// Use the constant
string weight = FontWeights.Strong;

Available constants:

  • Regular
  • Strong
  • Stronger

MessageSeverities

The MessageSeverities class provides severity levels for messages.

Usage examples:

// Instead of hard-coding
string severity = "warning";

// Use the constant
string severity = MessageSeverities.Warning;

Available constants:

  • Info
  • Positive
  • Warning
  • Danger

FramesContainerModes

The FramesContainerModes class provides mode for frames-container mode.

Usage examples:

// Instead of hard-coding
string mode = "tabs";

// Use the constant
string mode = FramesContainerModes.Tabs;

Available constants:

  • Tabs
  • Stack