Class MudToggleIconButton
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a button consisting of an icon that can be toggled between two distinct states.
public class MudToggleIconButton : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
- Inheritance
-
MudToggleIconButton
- 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
MudToggleIconButton()
public MudToggleIconButton()
Properties
ClickPropagation
Allows the click event to bubble up to the parent component.
[Parameter]
[Category("Behavior")]
public bool ClickPropagation { get; set; }
Property Value
Remarks
Defaults to false
.
Color
The color of the button.
[Parameter]
[Category("Appearance")]
public Color Color { get; set; }
Property Value
Remarks
Disabled
Disables interaction with the button.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
Remarks
Defaults to false
.
DropShadow
Displays a shadow.
[Parameter]
[Category("Appearance")]
public bool DropShadow { get; set; }
Property Value
Remarks
Defaults to true
.
Edge
Applies a negative margin.
[Parameter]
[Category("Appearance")]
public Edge Edge { get; set; }
Property Value
Remarks
Defaults to False.
Icon
The icon to use.
[Parameter]
[Category("Appearance")]
public string? Icon { get; set; }
Property Value
Ripple
Shows a ripple effect when the user clicks the button.
[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }
Property Value
Remarks
Defaults to true
.
Size
The size of the button.
[Parameter]
[Category("Appearance")]
public Size Size { get; set; }
Property Value
Remarks
Defaults to Medium.
Toggled
Whether the icon is in the toggled state.
[Parameter]
[Category("Behavior")]
public bool Toggled { get; set; }
Property Value
ToggledChanged
Occurs when Toggled is changed.
[Parameter]
public EventCallback<bool> ToggledChanged { get; set; }
Property Value
ToggledColor
An alternative color to use in the toggled state.
[Parameter]
[Category("Appearance")]
public Color? ToggledColor { get; set; }
Property Value
ToggledIcon
An alternative icon to use in the toggled state.
[Parameter]
[Category("Appearance")]
public string? ToggledIcon { get; set; }
Property Value
ToggledSize
An alternative size to use in the toggled state.
[Parameter]
[Category("Appearance")]
public Size? ToggledSize { get; set; }
Property Value
- Size?
ToggledVariant
An alternative variant to use in the toggled state.
[Parameter]
[Category("Appearance")]
public Variant? ToggledVariant { get; set; }
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
SetToggledAsync(bool)
protected Task SetToggledAsync(bool toggled)
Parameters
toggled
bool
Returns
Toggle()
Toggles the state of the button.
public Task Toggle()