Skip to content
CHOICE · FREE

Switch

A clear on and off toggle.

A clear on and off toggle, announced to assistive technology as a switch, for settings that take effect right away.

Why it helps

  • Obvious on and off
  • Announced as a switch
  • Works with forms

Where it fits

  • Notifications
  • Feature flags
  • Dark mode
Switch control in a RayCraft page

Example

<Switch @bind-Value="_on" Label="@($"Notifications: {(_on ? "on" : "off")}")" />

@code {
    private bool _on = true;
}

A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.

Included in RayCraft Free. Working examples are in the GitHub repository (MIT); it holds example and demo code, not the library code.

All controls ยท Documentation