Class ButtonBuilder
Provides utility methods for building button CSS classes.
public class ButtonBuilder
- Inheritance
-
ButtonBuilder
- Inherited Members
Constructors
ButtonBuilder(TwBlazorOptions, RoundedBuilder, ColorBuilder)
Provides utility methods for building button CSS classes.
public ButtonBuilder(TwBlazorOptions options, RoundedBuilder roundedBuilder, ColorBuilder colorBuilder)
Parameters
optionsTwBlazorOptionsroundedBuilderRoundedBuildercolorBuilderColorBuilder
Methods
GetBaseClasses(bool, bool, Rounded?)
Gets the base structure classes.
public string GetBaseClasses(bool iconButton, bool dense, Rounded? componentRounded = null)
Parameters
iconButtonboolWhether this is an icon button.
denseboolWhether the button has dense padding.
componentRoundedRounded?Component-level Rounded parameter value.
Returns
GetCursorClasses(bool, bool)
Gets the cursor state classes.
public string GetCursorClasses(bool disabled, bool @readonly)
Parameters
Returns
GetDisabledClasses(ButtonVariant?)
Gets the disabled state classes for any button variant.
public string GetDisabledClasses(ButtonVariant? variant)
Parameters
variantButtonVariant?
Returns
GetTypographyClasses(bool)
Gets the typography classes (Label Large: 14px, medium weight).
public string GetTypographyClasses(bool uppercase)
Parameters
uppercaseboolWhether to apply uppercase transformation.
Returns
GetVariantClasses(ButtonVariant?, Color?, bool, Shadow?)
Gets the CSS classes for a button based on its variant and color.
public string GetVariantClasses(ButtonVariant? variant, Color? color, bool disabled, Shadow? shadowOverride = null)
Parameters
variantButtonVariant?The button variant.
colorColor?The button color theme.
disabledboolWhether the button is disabled.
shadowOverrideShadow?When set, an explicit Shadow parameter was passed to the component instance and should take precedence over the Elevated variant's fixed Lg shadow.
Returns
- string
A string containing the appropriate CSS classes.