Class
TelerikButton

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:

cs-api-definition
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

TelerikButton()

Declaration

cs-api-definition
public TelerikButton()

Properties

ButtonSettings

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

Declaration

cs-api-definition
[Parameter]
public RenderFragment? ButtonSettings { get; set; }

Property Value

RenderFragment

ButtonType

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

Declaration

cs-api-definition
[Parameter]
public ButtonType ButtonType { get; set; }

Property Value

ButtonType

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.

EnableWebMcpTools

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.

Declaration

cs-api-definition
[Parameter]
public bool EnableWebMcpTools { get; set; }

Property Value

bool

Form

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

Declaration

cs-api-definition
[Parameter]
public string? Form { get; set; }

Property Value

string

OnClick

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

Declaration

cs-api-definition
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

Visible

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

Declaration

cs-api-definition
[Parameter]
public bool Visible { get; set; }

Property Value

bool

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

cs-api-definition
public override void Dispose()

Overrides BaseComponent.Dispose()

FocusAsync()

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

Declaration

cs-api-definition
public Task FocusAsync()

Returns

Task

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)