Table of Contents

Class ButtonBuilder

Namespace
TwBlazor.Builders
Assembly
TwBlazor.dll

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

options TwBlazorOptions
roundedBuilder RoundedBuilder
colorBuilder ColorBuilder

Methods

GetBaseClasses(bool, bool, Rounded?)

Gets the base structure classes.

public string GetBaseClasses(bool iconButton, bool dense, Rounded? componentRounded = null)

Parameters

iconButton bool

Whether this is an icon button.

dense bool

Whether the button has dense padding.

componentRounded Rounded?

Component-level Rounded parameter value.

Returns

string

GetCursorClasses(bool, bool)

Gets the cursor state classes.

public string GetCursorClasses(bool disabled, bool @readonly)

Parameters

disabled bool

Whether the button is disabled.

readonly bool

Whether the button is readonly.

Returns

string

GetDisabledClasses(ButtonVariant?)

Gets the disabled state classes for any button variant.

public string GetDisabledClasses(ButtonVariant? variant)

Parameters

variant ButtonVariant?

Returns

string

GetTypographyClasses(bool)

Gets the typography classes (Label Large: 14px, medium weight).

public string GetTypographyClasses(bool uppercase)

Parameters

uppercase bool

Whether to apply uppercase transformation.

Returns

string

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

variant ButtonVariant?

The button variant.

color Color?

The button color theme.

disabled bool

Whether the button is disabled.

shadowOverride Shadow?

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.