New to Telerik UI for Blazor? Start a free 30-day trial
Disabled Button
Updated over 6 months ago
Sometimes specific buttons in an application must be temporarily disabled. To control the enabled state of the component, use the Enabled Boolean attribute.
Enabled="false"renders adisabledattribute on the<button>element. A disabled Button will fire itsOnClickhandler if the user removes thedisabledattribute via the browser's developer console. This behavior is consistent with standard buttons. For sensitive tasks, verify the button state in theOnClickhandler and perform any other relevant checks.
The following example demonstrates how to enable and disable the Button.
Toggle Telerik Button Enabled State
<p>
<label>
<TelerikCheckBox @bind-Value="@ButtonIsEnabled" /> Toggle Button State
</label>
</p>
<TelerikButton Enabled="@ButtonIsEnabled">@ButtonText</TelerikButton>
@code {
bool ButtonIsEnabled { get; set; } = false;
string ButtonText => ButtonIsEnabled ? "Enabled Button" : "Disabled Button";
}