Class MudField
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
A component similar to MudTextField<T> which supports custom content.
public class MudField : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
- Inheritance
-
MudField
- Implements
- Inherited Members
- Extension Methods
Constructors
MudField()
public MudField()
Properties
Adornment
The location of the adornment icon or text.
[Parameter]
[Category("Behavior")]
public Adornment Adornment { get; set; }
Property Value
Remarks
Defaults to None. When set to Start
or End
, the AdornmentText will be displayed, or AdornmentIcon if no adornment text is specified.
AdornmentClassname
protected string AdornmentClassname { get; }
Property Value
AdornmentColor
The color of AdornmentText or AdornmentIcon.
[Parameter]
[Category("Appearance")]
public Color AdornmentColor { get; set; }
Property Value
Remarks
Defaults to Default.
AdornmentIcon
The icon displayed for the adornment.
[Parameter]
[Category("Behavior")]
public string? AdornmentIcon { get; set; }
Property Value
Remarks
Defaults to null
. This icon will be displayed when Adornment is Start
or End
, and no value for AdornmentText is set.
AdornmentText
The text displayed for the adornment.
[Parameter]
[Category("Behavior")]
public string? AdornmentText { get; set; }
Property Value
Remarks
Defaults to null
. This text will be displayed when Adornment is Start
or End
. The AdornmentIcon property will be ignored if this property is set.
ChildContent
The content within this field.
[Parameter]
[Category("Data")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Disabled
Prevents the user from interacting with this field.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
Remarks
Defaults to false
.
Error
Displays the error in ErrorText.
[Parameter]
[Category("Validation")]
public bool Error { get; set; }
Property Value
Remarks
Defaults to false
.
ErrorText
A description of this field's error that is displayed under the field when Error is true
.
[Parameter]
[Category("Validation")]
public string? ErrorText { get; set; }
Property Value
FullWidth
Sets the width of the field to the width of the container.
[Parameter]
[Category("Appearance")]
public bool FullWidth { get; set; }
Property Value
Remarks
Defaults to false
.
HelperText
The text displayed below the text field.
[Parameter]
[Category("Behavior")]
public string? HelperText { get; set; }
Property Value
Remarks
Typically used to help the user understand what kind of input is allowed.
IconSize
The size of the icon.
[Parameter]
[Category("Appearance")]
public Size IconSize { get; set; }
Property Value
Remarks
Defaults to Medium.
InnerClassname
protected string InnerClassname { get; }
Property Value
InnerPadding
Displays padding for the content within this field.
[Parameter]
[Category("Appearance")]
public bool InnerPadding { get; set; }
Property Value
Remarks
Defaults to true
.
InputControlClassname
protected string InputControlClassname { get; }
Property Value
Label
The label for this input.
[Parameter]
[Category("Behavior")]
public string? Label { get; set; }
Property Value
Remarks
If no value is specified, the label will be displayed in the input. Otherwise, it will be scaled down to the top of the input.
Margin
The vertical spacing for this field.
[Parameter]
[Category("Appearance")]
public Margin Margin { get; set; }
Property Value
Remarks
Defaults to None.
OnAdornmentClick
Occurs when the adornment text or icon has been clicked.
[Parameter]
public EventCallback<MouseEventArgs> OnAdornmentClick { get; set; }
Property Value
Typo
Typography for the field text.
[Parameter]
[Category("Appearance")]
public Typo Typo { get; set; }
Property Value
Underline
Displays an underline for this field.
[Parameter]
[Category("Appearance")]
public bool Underline { get; set; }
Property Value
Remarks
Defaults to true
.
Variant
The display variant of the field.
[Parameter]
[Category("Appearance")]
public Variant Variant { get; set; }
Property Value
Remarks
Defaults to Text.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder