Table of Contents

Class ChipBuilder

Namespace
TwBlazor.Builders
Assembly
TwBlazor.dll

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

options TwBlazorOptions
buttonBuilder ButtonBuilder
colorBuilder ColorBuilder

Methods

GetBaseClasses(ChipSize, bool, bool)

Gets the base structure classes for a chip.

public string GetBaseClasses(ChipSize size, bool clickable, bool disabled)

Parameters

size ChipSize

The chip size.

clickable bool

Whether the chip is clickable.

disabled bool

Whether the chip is disabled.

Returns

string

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

variant ButtonVariant

The visual style variant to apply to the button. Determines the overall appearance, such as filled, outlined, text, or tonal.

color Color

The color to use for the button, which influences the resulting CSS classes and visual styling.

disabled bool

A value indicating whether the button is disabled. If set to true, disabled styles are applied.

clickable bool

Whether 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.