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

Button

The standard button component supports multiple variants and states. Use it for actions, form submission, and navigation triggers.

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

Button

MgButton

The standard button component supports multiple variants based on Material Design 3 guidelines.

API Reference: MgButton

Property Type Default Description
DisplayText string "" The text to display on the button.
Variant MgButtonVariant Filled The visual style of the button.
Disabled bool false Disables user interaction.
OnClick EventCallback<MgButton> - Callback triggered when the button is clicked.
IconName string null Optional icon to display before the text (e.g., "bi bi-gear").
ChildContent RenderFragment null Custom content to render inside the button. Overrides DisplayText.
An unhandled error has occurred. Reload 🗙