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 roundings 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.OnAfterRenderAsync(bool)BaseComponent.Dispose()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.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

ButtonType

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.

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)

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