Button Class

Use Blazor Bootstrap button styles for actions in forms, dialogs, and more with support for multiple sizes, states, etc.
This component is based on the Bootstrap Button component.

Definition

Namespace: BlazorBootstrap
Assembly: BlazorBootstrap (in BlazorBootstrap.dll) Version: 0.7+45c8d9adb5970d727cceec44a5ed61aea0016e50
public sealed class Button : BlazorBootstrapComponentBase
Inheritance
Object    ComponentBase    BlazorBootstrapComponentBase    Button

Remarks

We do not use the "data-loading-text" HTML attribute given it has been a known vector for XSS attacks.
Officially this is patched, but we're not taking any chances.
For more information, see and

Constructors

ButtonInitializes a new instance of the Button class

Properties

Active Gets or sets the button active state.
Block Gets or sets the block level button.
ChildContent Gets or sets the content to be rendered within the component.
Color Gets or sets the button color.
Disabled Gets or sets the button disabled state.
Loading If , shows the loading spinner or a LoadingTemplate.
LoadingTemplate Gets or sets the button loading template. This can be left empty.
Position Gets or sets the position. Use Position to modify a Badge and position it in the corner of a link or button.
Size Gets or sets the button size.
TabIndex Gets or sets the button tab index.
Target Gets or sets the link button target.
To Gets or sets the link button href attribute.
TooltipColor Gets or sets the button tooltip color.
TooltipPlacement Gets or sets the button tooltip placement.
TooltipTitle Gets or sets the button tooltip title.
Type Gets or sets the button type.

Methods

HideLoading Hides the loading state and enables the button.
SetParametersAsync Parameters are loaded manually for sake of performance. https://learn.microsoft.com/en-us/aspnet/core/blazor/performance#implement-setparametersasync-manually
(Overrides ComponentBaseSetParametersAsync(ParameterView))
ShowLoading Shows the loading state and disables the button.

See Also