ClassTelerikSwitch<TValue>
A toggle component for switching between two states (on/off) with labels and theming.
Configure width via Width, labels with OnLabel and OffLabel (localized through Switch_OnLabel/Switch_OffLabel), track/thumb roundness using TrackRounded and ThumbRounded, and size through Size.
Supports two-way binding through TelerikInputBase{TValue} (Value/ValueChanged), and raises change/blur via the base input events.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Type Parameters:
TValue
Syntax:
public class TelerikSwitch<TValue> : TelerikInputBase<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentTelerikInputBase<TValue>TelerikSwitch<TValue>
Implements:
Inherited Members
Constructors
TelerikSwitch()
Declaration
public TelerikSwitch()
Properties
OffLabel
Defines the off label of the switch. If not set, its value is set through the localizaiton Switch_OffLabel, or "Off" if there is no localization.
Declaration
[Parameter]
public string OffLabel { get; set; }
Property Value
OnLabel
Defines the on label of the switch. If not set, its value is set through the localizaiton Switch_OnLabel, or "On" if there is no localization.
ThumbRounded
Defines the roundness of the switch thumb. The default value is Full.
Declaration
[Parameter]
public string ThumbRounded { get; set; }
Property Value
TrackRounded
Defines the roundness of the switch track. The default value is Full.
Declaration
[Parameter]
public string TrackRounded { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
OnAfterRender(bool)
Declaration
protected override void OnAfterRender(bool firstRender)
Parameters
firstRender
Overrides