Switch

Toggles between two values with the tap of a button, visually distinct from checkboxes. Use switches (not radio buttons) if the items in a list can be independently controlled.

Basic switches

<MudSwitch @bind-Value="Basic_Switch1" />
<MudSwitch @bind-Value="Basic_Switch2" Color="Color.Primary" />
<MudSwitch @bind-Value="Basic_Switch3" Color="Color.Secondary" />
<MudSwitch T="bool" Disabled="true" />
@code{
    public bool Basic_Switch1 { get; set; } = false;
    public bool Basic_Switch2 { get; set; } = true;
    public bool Basic_Switch3 { get; set; } = true;
}
Color

<MudSwitch @bind-Value="Basic_Switch1" Color="Color.Success" UncheckedColor="Color.Error" />
<MudSwitch @bind-Value="Basic_Switch2" Color="Color.Primary" UncheckedColor="Color.Secondary" />
<MudSwitch @bind-Value="Basic_Switch3" Color="Color.Info" UncheckedColor="Color.Warning" />
<MudSwitch T="bool" Disabled="true" UncheckedColor="Color.Default" />
@code{
    public bool Basic_Switch1 { get; set; } = false;
    public bool Basic_Switch2 { get; set; } = true;
    public bool Basic_Switch3 { get; set; } = true;
}
Switch with label

Text can be added using the Label property and its position can be specified using the LabelPlacement property

<MudSwitch @bind-Value="Label_Switch1" Label="Info" Color="Color.Info" />
<MudSwitch @bind-Value="Label_Switch2" Label="Success" Color="Color.Success" />
<MudSwitch @bind-Value="Label_Switch3" Label="Warning!" LabelPlacement="Placement.Start" Color="Color.Warning" />
<MudSwitch T="bool" Disabled="true" Label="Disabled" LabelPlacement="Placement.Start" />
@code{
    public bool Label_Switch1 { get; set; } = false;
    public bool Label_Switch2 { get; set; } = true;
    public bool Label_Switch3 { get; set; } = true;
}
An unhandled exception has occurred. See browser dev tools for details. Reload 🗙