Default Light
MgLibrary
Overview
Installation
Buttons
Cards
Charts
Codes
Data Grids
Dropdowns
Editors
Headers & Animations
Icons
Indicators
Inputs
Lists
Modals
Menus
Panels
Pills & Chips
Scheduling
Tabs
Time Line
Trees
Customization

Toggle Button

Toggle buttons represent an on/off state and can be used as switches. They support labels and change events to reflect state.

Use this example to explore default behavior, customization points, and accessibility-friendly patterns in a real Blazor page.

Toggle Button

MgToggleButton

API Reference: MgToggleButton

Property Type Default Description
IsOn bool false The current state of the toggle.
DisplayText string "" Optional label to display next to the toggle.
ToggleClicked EventCallback<bool> - Triggered when the toggle is clicked.
An unhandled error has occurred. Reload 🗙