Table of Contents

Class MudInputControl

Namespace
MudBlazor
Assembly
MudBlazor.dll

A base class for designing input components.

public class MudInputControl : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
Inheritance
MudInputControl
Implements
Inherited Members
Extension Methods

Constructors

MudInputControl()

public MudInputControl()

Properties

ChildContent

The content within this component.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

CounterText

The current and maximum number of characters, displayed below the text field.

[Parameter]
public string? CounterText { get; set; }

Property Value

string

Remarks

Used to help users know when they are at a maximum character limit.

Disabled

Prevents the user from changing this input's value.

[Parameter]
public bool Disabled { get; set; }

Property Value

bool

Remarks

Defaults to false.

Error

Displays the Label in an error state.

[Parameter]
public bool Error { get; set; }

Property Value

bool

Remarks

Defaults to false. When true, the error in ErrorText will be displayed.

ErrorId

The ID that will be used by aria-describedby if ErrorText is set.

[Parameter]
public string? ErrorId { get; set; }

Property Value

string

Remarks

When set, the aria-describedby attribute is set to the ID.

ErrorText

The description of the error to display when Error is true.

[Parameter]
public string? ErrorText { get; set; }

Property Value

string

ForId

The ID of the input component related to the label specified in Label.

[Parameter]
public string? ForId { get; set; }

Property Value

string

FullWidth

Expands this input to the width of its container.

[Parameter]
public bool FullWidth { get; set; }

Property Value

bool

Remarks

Defaults to false.

HelperClass

protected string HelperClass { get; }

Property Value

string

HelperContainer

protected string HelperContainer { get; }

Property Value

string

HelperId

The ID that will be used by aria-describedby if HelperText is set.

[Parameter]
public string? HelperId { get; set; }

Property Value

string

HelperText

The text which describes which kind of input is expected.

[Parameter]
public string? HelperText { get; set; }

Property Value

string

Remarks

Defaults to null. This text is be displayed below the text field.

HelperTextOnFocus

Displays the HelperText only when this input has focus.

[Parameter]
public bool HelperTextOnFocus { get; set; }

Property Value

bool

Remarks

Defaults to false.

InputContent

The input component within this component.

[Parameter]
public RenderFragment? InputContent { get; set; }

Property Value

RenderFragment

Label

The label for this input.

[Parameter]
public string? Label { get; set; }

Property Value

string

Remarks

When this input has no value, the label is displayed inside the text box. Otherwise, the label is scaled down to the top of the input.

Margin

The spacing above and below this component.

[Parameter]
public Margin Margin { get; set; }

Property Value

Margin

Remarks

Defaults to None.

Required

Displays an asterisk to indicate an input is required.

[Parameter]
public bool Required { get; set; }

Property Value

bool

Remarks

Defaults to false.

Variant

The display variant for this input.

[Parameter]
public Variant Variant { get; set; }

Property Value

Variant

Remarks

Defaults to Text. Other values include Filled and Outlined.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder