Class MudButton
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a button for actions, links, and commands.
public class MudButton : MudBaseButton, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IDisposable
- Inheritance
-
MudButton
- Implements
- Inherited Members
- Extension Methods
Remarks
Creates a button element,
or anchor if Href
is set.
You can directly add attributes like title
or aria-label
.
Constructors
MudButton()
public MudButton()
Properties
ChildContent
The content within this component.
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Color
The color of the button.
[Parameter]
[Category("Appearance")]
public Color Color { get; set; }
Property Value
Remarks
EndIcon
The icon displayed after the text.
[Parameter]
[Category("Behavior")]
public string? EndIcon { get; set; }
Property Value
Remarks
Defaults to null
. Use StartIcon to display an icon before the text.
EndIconClass
protected string EndIconClass { get; }
Property Value
FullWidth
Expands the button to 100% of the container width.
[Parameter]
[Category("Appearance")]
public bool FullWidth { get; set; }
Property Value
Remarks
Defaults to false
.
IconClass
The CSS classes applied to icons.
[Parameter]
[Category("Appearance")]
public string? IconClass { get; set; }
Property Value
Remarks
Defaults to null
. You can use spaces to separate multiple classes.
IconColor
The color of icons.
[Parameter]
[Category("Appearance")]
public Color IconColor { get; set; }
Property Value
Remarks
Defaults to Inherit.
IconSize
The size of icons.
[Parameter]
[Category("Appearance")]
public Size? IconSize { get; set; }
Property Value
- Size?
Remarks
Defaults to null
. When null
, the value of Size is used.
Size
The size of the button.
[Parameter]
[Category("Appearance")]
public Size Size { get; set; }
Property Value
Remarks
StartIcon
The icon displayed before the text.
[Parameter]
[Category("Behavior")]
public string? StartIcon { get; set; }
Property Value
Remarks
Defaults to null
. Use EndIcon to display an icon after the text.
StartIconClass
protected string StartIconClass { get; }
Property Value
Variant
The display variation to use.
[Parameter]
[Category("Appearance")]
public Variant Variant { get; set; }
Property Value
Remarks
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
Dispose()
public void Dispose()
Dispose(bool)
Releases resources used by this button.
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
OnInitialized()
protected override void OnInitialized()