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 | Description | Type | Default |
|---|---|---|---|
Active |
When set to 'true', places the component in the active state with active styling. |
bool | false |
Block |
Makes the button to span the full width of a parent. |
bool | false |
ChildContent |
Specifies the content to be rendered inside this Button. |
RenderFragment | null |
Color |
Specifies the button color. |
Color | Color.Default |
Command |
Specifies the command to be executed when clicked on a button. |
ICommand | null |
CommandParameter |
Reflects the parameter to pass to the CommandProperty upon execution. |
object | null |
ContextMenuPreventDefault |
Prevents the browser's default context menu. |
bool | false |
Disabled |
When set to 'true', disables the component's functionality and places it in a disabled state. |
bool | false |
Intent |
Specifies the button intent. |
Intent | null |
Loading |
Shows the loading spinner or a LoadingTemplate. |
bool | false |
LoadingTemplate |
Defines the component loading template. |
RenderFragment | null |
Outline |
Makes the button to have the outlines. |
bool | false |
PreventDefaultOnSubmit |
Prevents a default form-post when button type is set to Submit. |
bool | false |
Size |
Changes the size of a button. |
Size? | null |
StretchedLink |
Makes any HTML element or component clickable by “stretching” a nested link. |
bool | false |
TabIndex |
If defined, indicates that its element can be focused and can participates in sequential keyboard navigation. |
int? | null |
Target |
The target attribute specifies where to open the linked document for a Link. |
Target | Target.Default |
To |
Denotes the target route of the Link button. |
string | |
Type |
Specifies the button type. Possible values: |
ButtonType | ButtonType.Button |
Buttons
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Specifies the content to be rendered inside this Buttons. |
RenderFragment | null |
Orientation |
Specifies the button group orientation mode. Possible values: |
Orientation | Orientation.Horizontal |
Role |
Specifies the role of the button group. Possible values: |
ButtonsRole | ButtonsRole.Addons |
Size |
Change the size of multiple buttons at once. Possible values: |
Size | Size.Default |
Events
Button
| Event | Description | Type |
|---|---|---|
ActiveChanged |
Notifies when the active state changes. When assigned, clicking the button toggles its active state. |
EventCallback<bool> |
Clicked |
Notifies when the button is clicked. |
EventCallback<MouseEventArgs> |
ContextMenu |
Notifies when the button context menu is requested. |
EventCallback<MouseEventArgs> |
Methods
Button
| Method | Description | Return | Parameters |
|---|---|---|---|
Click |
Programmatically clicks the button. | Task | |
Focus |
Sets focus on the button element, if it can be focused. | Task | bool scrollToElement |