Table of Contents

Class MudSwitch<T>

Namespace
MudBlazor
Assembly
MudBlazor.dll
public class MudSwitch<T> : MudBooleanInput<T>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IDisposable

Type Parameters

T
Inheritance
MudSwitch<T>
Implements
Inherited Members
Extension Methods

Constructors

MudSwitch()

public MudSwitch()

Properties

ChildContent

[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

Color

The color of the component. It supports the theme colors.

[Parameter]
[Category("Appearance")]
public Color Color { get; set; }

Property Value

Color

Label

The text/label will be displayed next to the switch if set.

[Parameter]
[Category("Behavior")]
public string? Label { get; set; }

Property Value

string

LabelClassname

protected string LabelClassname { get; }

Property Value

string

LabelPosition

The position of the text/label.

[Parameter]
[Category("Behavior")]
public LabelPosition LabelPosition { get; set; }

Property Value

LabelPosition

Ripple

Gets or sets whether to show a ripple effect when the user clicks the button. Default is true.

[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }

Property Value

bool

Size

The Size of the switch.

[Parameter]
[Category("Appearance")]
public Size Size { get; set; }

Property Value

Size

SpanClassname

protected string SpanClassname { get; }

Property Value

string

SwitchClassname

protected string SwitchClassname { get; }

Property Value

string

SwitchLabelClassname

protected string SwitchLabelClassname { get; }

Property Value

string

ThumbClassname

protected string ThumbClassname { get; }

Property Value

string

ThumbIcon

Shows an icon on Switch's thumb.

[Parameter]
[Category("Appearance")]
public string? ThumbIcon { get; set; }

Property Value

string

ThumbIconColor

The color of the thumb icon. Supports the theme colors.

[Parameter]
[Category("Appearance")]
public Color ThumbIconColor { get; set; }

Property Value

Color

TrackClassname

protected string TrackClassname { get; }

Property Value

string

UncheckedColor

The base color of the component in its none active/unchecked state. It supports the theme colors.

[Parameter]
[Category("Appearance")]
public Color UncheckedColor { get; set; }

Property Value

Color

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

HandleKeyDown(KeyboardEventArgs)

protected void HandleKeyDown(KeyboardEventArgs obj)

Parameters

obj KeyboardEventArgs

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

OnInitialized()

protected override void OnInitialized()