Class ChipBuilder
Provides utility methods for building chip CSS classes.
public class ChipBuilder
- Inheritance
-
ChipBuilder
- Inherited Members
Constructors
ChipBuilder(TwBlazorOptions, ButtonBuilder, ColorBuilder)
Provides utility methods for building chip CSS classes.
public ChipBuilder(TwBlazorOptions options, ButtonBuilder buttonBuilder, ColorBuilder colorBuilder)
Parameters
optionsTwBlazorOptionsbuttonBuilderButtonBuildercolorBuilderColorBuilder
Methods
GetBaseClasses(ChipSize, bool, bool)
Gets the base structure classes for a chip.
public string GetBaseClasses(ChipSize size, bool clickable, bool disabled)
Parameters
sizeChipSizeThe chip size.
clickableboolWhether the chip is clickable.
disabledboolWhether the chip is disabled.
Returns
GetVariantClasses(ButtonVariant, Color, bool, bool)
Generates the CSS class string for a button based on its visual variant, color, disabled state, and theme.
public string GetVariantClasses(ButtonVariant variant, Color color, bool disabled, bool clickable = true)
Parameters
variantButtonVariantThe visual style variant to apply to the button. Determines the overall appearance, such as filled, outlined, text, or tonal.
colorColorThe color to use for the button, which influences the resulting CSS classes and visual styling.
disabledboolA value indicating whether the button is disabled. If set to true, disabled styles are applied.
clickableboolWhether the chip is interactive. When false, hover/active state classes are stripped so a non-interactive chip doesn't visually imply interactivity it doesn't have.
Returns
- string
A string containing the CSS classes that correspond to the specified button variant, color, and state.
Remarks
If the button is disabled, the returned CSS classes will reflect the disabled state regardless of the specified color or variant.