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
-
objectComponentBaseBOBButton
- 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
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
Density
Vertical density (gap) of the button.
[Parameter]
public BOBDensity Density { get; set; }
Property Value
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
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
Loading
When true, the button shows a loading indicator and is non-interactive.
[Parameter]
public bool Loading { get; set; }
Property Value
- bool
LoadingIndicatorVariant
[Parameter]
public BOBProgressIconVariant? LoadingIndicatorVariant { get; set; }
Property Value
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
Size
Visual size of the button.
[Parameter]
public BOBSize Size { get; set; }
Property Value
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
Transitions
Transition classes applied to the button element.
[Parameter]
public BOBTransitions? Transitions { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
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()