New to Telerik UI for BlazorStart a free 30-day trial

Represents a Telerik UI for Blazor Button component that handles user clicks, form submissions, and navigation actions. Supports icons, multiple styling options, accessibility features, and various button types including submit, reset, and standard buttons. Can be styled with different fill modes, sizes, colors, and corner rounding to match your application's design requirements.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikButton : ButtonBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentButtonBaseTelerikButton

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members ButtonBase.IdButtonBase.ChildContentButtonBase.TitleButtonBase.IconButtonBase.EnabledButtonBase.TabIndexButtonBase.FillModeButtonBase.RoundedButtonBase.SizeButtonBase.ThemeColorButtonBase.AriaLabelButtonBase.AriaLabelledByButtonBase.AriaDescribedByButtonBase.AriaControlsBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)...

Constructors

C#
public TelerikButton()

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
public override void Dispose()

Overrides: BaseComponent.Dispose()

Programmatically moves focus to the button. The button must be Visible and Enabled to receive focus successfully.

C#
public Task FocusAsync()
Returns:

Task

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

Properties

Provides configuration for WebMCP tools, such as a Name to distinguish this Button from others on the same page.

C#
[Parameter]
public RenderFragment? ButtonSettings { get; set; }

[Accessibility] Sets the HTML button type attribute which determines the button's behavior when clicked. Default value is Submit.

C#
[Parameter]
public ButtonType ButtonType { get; set; }
Remarks:

Submit submits the parent form when clicked. Button performs no default action and is used with custom OnClick handlers. Reset resets all form controls to their initial values.

Enables the registration of WebMCP tools for this Button instance. When set to true, the Button click operation is exposed as a tool discoverable by AI models through the browser. Default value is false.

C#
[Parameter]
public bool EnableWebMcpTools { get; set; }

Associates the button with a specific form element by referencing the form's ID attribute. Example: "myFormId".

C#
[Parameter]
public string? Form { get; set; }

Fires when the user clicks the button. The event provides MouseEventArgs containing details about the click event.

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

Controls whether the button appears on the page. When set to false, the button is hidden from view. Default value is true.

C#
[Parameter]
public bool Visible { get; set; }