Table of Contents

Class BOBButton

Namespace
BlazOrbit.Components
Assembly
BlazOrbit.dll
[GenerateComponentInfo]
public class BOBButton : BOBVariantComponentBase<BOBButton, BOBButtonVariant>, IVariantComponent<BOBButtonVariant>, IVariantComponent, IHasTransitions, IHasSize, IHasFullWidth, IHasLoading, IHasShadow, IHasRipple, IJsBehavior, IHasDensity, IHasBorder, IHasBackgroundColor, IHasColor, IHasDisabled
Inheritance
object
ComponentBase
BOBButton
Implements
Inherited Members

Constructors

BOBButton()

public BOBButton()

Properties

AriaLabel

Accessible name for the button. Required when the button has no visible text (icon-only, ChildContent-only without text). Forwarded to the inner <button> element. WCAG 4.1.2 Name, Role, Value.

[Parameter]
public string? AriaLabel { get; set; }

Property Value

string

BackgroundColor

Background color of the button. Accepts any valid CSS color value, PaletteColor or BOBColor.

[Parameter]
public string? BackgroundColor { get; set; }

Property Value

string

Border

Border style applied to the button.

[Parameter]
public BorderStyle? Border { get; set; }

Property Value

BorderStyle

BuiltInTemplates

protected override Dictionary<BOBButtonVariant, Func<BOBButton, RenderFragment>> BuiltInTemplates { get; }

Property Value

Dictionary<BOBButtonVariant, Func<BOBButton, RenderFragment>>

ChildContent

Customizable Button content.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Color

Text and icon color of the button. Accepts any valid CSS color value, PaletteColor or BOBColor.

[Parameter]
public string? Color { get; set; }

Property Value

string

DefaultVariant

Default variant used when no explicit variant is specified.

public override BOBButtonVariant DefaultVariant { get; }

Property Value

BOBButtonVariant

Density

Vertical density (gap) of the button.

[Parameter]
public BOBDensity Density { get; set; }

Property Value

BOBDensity

DisableRipple

When true, the ripple effect on click is disabled.

[Parameter]
public bool DisableRipple { get; set; }

Property Value

bool

Disabled

When true, the button is non-interactive.

[Parameter]
public bool Disabled { get; set; }

Property Value

bool

FullWidth

When true, the button spans the full width of its container.

[Parameter]
public bool FullWidth { get; set; }

Property Value

bool

IsDisabled

Computed disabled state � true when either Disabled or Loading is set.

public bool IsDisabled { get; }

Property Value

bool

LeadingIcon

Closed-catalog icon key rendered before the button text.

[Parameter]
public IconKey? LeadingIcon { get; set; }

Property Value

IconKey?

Loading

When true, the button shows a loading indicator and is non-interactive.

[Parameter]
public bool Loading { get; set; }

Property Value

bool

LoadingIndicatorVariant

Variant of the loading indicator shown when Loading is true.

[Parameter]
public BOBProgressIconVariant? LoadingIndicatorVariant { get; set; }

Property Value

BOBProgressIconVariant

OnClick

Raised when the button is clicked and not disabled.

[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

RippleColor

Custom CSS color for the ripple effect.

[Parameter]
public string? RippleColor { get; set; }

Property Value

string

RippleDurationMs

Duration of the ripple animation in milliseconds.

[Parameter]
public int? RippleDurationMs { get; set; }

Property Value

int?

Shadow

Shadow style applied to the button.

[Parameter]
public ShadowStyle? Shadow { get; set; }

Property Value

ShadowStyle

Size

Visual size of the button.

[Parameter]
public BOBSize Size { get; set; }

Property Value

BOBSize

Text

Text displayed inside the button. Ignored when ChildContent is provided.

[Parameter]
public string? Text { get; set; }

Property Value

string

TrailingIcon

Closed-catalog icon key rendered after the button text.

[Parameter]
public IconKey? TrailingIcon { get; set; }

Property Value

IconKey?

Transitions

Transition classes applied to the button element.

[Parameter]
public BOBTransitions? Transitions { get; set; }

Property Value

BOBTransitions

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

GetRippleContainer()

Gets the Microsoft.AspNetCore.Components.ElementReference that hosts the ripple effect.

public virtual ElementReference GetRippleContainer()

Returns

ElementReference

OnParametersSet()

Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.

protected override void OnParametersSet()