Table of Contents

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

Adornment

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

string

AdornmentColor

The color of AdornmentText or AdornmentIcon.

[Parameter]
[Category("Appearance")]
public Color AdornmentColor { get; set; }

Property Value

Color

Remarks

Defaults to Default.

AdornmentIcon

The icon displayed for the adornment.

[Parameter]
[Category("Behavior")]
public string? AdornmentIcon { get; set; }

Property Value

string

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

string

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

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

Disabled

Prevents the user from interacting with this field.

[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }

Property Value

bool

Remarks

Defaults to false.

Error

Displays the error in ErrorText.

[Parameter]
[Category("Validation")]
public bool Error { get; set; }

Property Value

bool

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

string

FullWidth

Sets the width of the field to the width of the container.

[Parameter]
[Category("Appearance")]
public bool FullWidth { get; set; }

Property Value

bool

Remarks

Defaults to false.

HelperText

The text displayed below the text field.

[Parameter]
[Category("Behavior")]
public string? HelperText { get; set; }

Property Value

string

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

Size

Remarks

Defaults to Medium.

InnerClassname

protected string InnerClassname { get; }

Property Value

string

InnerPadding

Displays padding for the content within this field.

[Parameter]
[Category("Appearance")]
public bool InnerPadding { get; set; }

Property Value

bool

Remarks

Defaults to true.

InputControlClassname

protected string InputControlClassname { get; }

Property Value

string

Label

The label for this input.

[Parameter]
[Category("Behavior")]
public string? Label { get; set; }

Property Value

string

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

Margin

Remarks

Defaults to None.

OnAdornmentClick

Occurs when the adornment text or icon has been clicked.

[Parameter]
public EventCallback<MouseEventArgs> OnAdornmentClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

Typo

Typography for the field text.

[Parameter]
[Category("Appearance")]
public Typo Typo { get; set; }

Property Value

Typo

Underline

Displays an underline for this field.

[Parameter]
[Category("Appearance")]
public bool Underline { get; set; }

Property Value

bool

Remarks

Defaults to true.

Variant

The display variant of the field.

[Parameter]
[Category("Appearance")]
public Variant Variant { get; set; }

Property Value

Variant

Remarks

Defaults to Text.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

See Also