Blazorise Button API
Explore the Blazorise Button API reference for parameters, events, methods, and related types.
For examples and usage guidance, see the Button documentation.
API
Parameters
Button
| Parameter | Default | Type |
|---|---|---|
Active | false | bool |
When set to 'true', places the component in the active state with active styling. | ||
Block | false | bool |
Makes the button to span the full width of a parent. | ||
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this Button. | ||
Color | Color.Default | Color |
Specifies the button color. | ||
Command | null | ICommand |
Specifies the command to be executed when clicked on a button. | ||
CommandParameter | null | object |
Reflects the parameter to pass to the CommandProperty upon execution. | ||
ContextMenuPreventDefault | false | bool |
Prevents the browser's default context menu. | ||
Disabled | false | bool |
When set to 'true', disables the component's functionality and places it in a disabled state. | ||
Ghost | false | bool |
Gets or sets whether to use a transparent, borderless appearance with provider-specific interaction states. Color controls the foreground and interaction palette. This appearance takes precedence over Outline. | ||
Intent | null | Intent |
Specifies the button intent. | ||
Loading | false | bool |
Shows the loading spinner or a LoadingTemplate. | ||
LoadingTemplate | null | RenderFragment |
Defines the component loading template. | ||
Outline | false | bool |
Makes the button to have the outlines. | ||
PreventDefaultOnSubmit | false | bool |
Prevents a default form-post when button type is set to Submit. | ||
Size | Default | Size? |
Changes the size of a button. When omitted, uses the parent Addons size, then the theme input size, then Size.Default. | ||
StretchedLink | false | bool |
Makes any HTML element or component clickable by “stretching” a nested link. | ||
TabIndex | null | int? |
If defined, indicates that its element can be focused and can participates in sequential keyboard navigation. | ||
Target | Target.Default | Target |
The target attribute specifies where to open the linked document for a Link. | ||
To | — | string |
Denotes the target route of the Link button. | ||
Type | Button | ButtonType |
Specifies the button type. Possible values: ButtonSubmitResetLink | ||
Buttons
| Parameter | Default | Type |
|---|---|---|
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this Buttons. | ||
Orientation | Horizontal | Orientation |
Specifies the button group orientation mode. Possible values: HorizontalVertical | ||
Role | Addons | ButtonsRole |
Specifies the role of the button group. Possible values: AddonsToolbar | ||
Size | Default | Size |
Change the size of multiple buttons at once. Possible values: DefaultExtraSmallSmallMediumLargeExtraLarge | ||
Events
Button
| Event | Type |
|---|---|
ActiveChanged | EventCallback<bool> |
Notifies when the active state changes. When assigned, clicking the button toggles its active state. | |
Clicked | EventCallback<MouseEventArgs> |
Notifies when the button is clicked. | |
ContextMenu | EventCallback<MouseEventArgs> |
Notifies when the button context menu is requested. | |
Methods
Button
| Method | Return | Parameters |
|---|---|---|
Click | Task | — |
Programmatically clicks the button.
| ||
Focus | Task | bool scrollToElement |
Sets focus on the button element, if it can be focused.
| ||