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,ForegroundPrimary50toPrimary950Neutral50toNeutral950Success50toSuccess950Warning50toWarning950Danger50toDanger950Info50toInfo950
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:
NoneExtraSmallSmallMediumLargeExtraLarge
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:
RegularStrongStronger
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:
InfoPositiveWarningDanger
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:
TabsStack