Class MudInput<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
A component for collecting an input value.
public class MudInput<T> : MudBaseInput<T>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IAsyncDisposable
Type Parameters
T
The type of object managed by this input.
- Inheritance
-
MudBaseInput<T>MudInput<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
MudInput()
public MudInput()
Properties
AdornmentClassname
protected string AdornmentClassname { get; }
Property Value
AutoGrow
Stretches this input vertically to accommodate the Text value.
[Parameter]
public bool AutoGrow { get; set; }
Property Value
Remarks
Defaults to false
.
ChildContent
The content within this input component.
[Parameter]
public RenderFragment? ChildContent { get; set; }
Property Value
Remarks
Classname
protected string Classname { get; }
Property Value
ClearButtonClassname
protected string ClearButtonClassname { get; }
Property Value
ClearIcon
The icon to display when Clearable is true
.
[Parameter]
public string ClearIcon { get; set; }
Property Value
Remarks
Defaults to Clear.
Clearable
Shows a button to clear this input's value.
[Parameter]
public bool Clearable { get; set; }
Property Value
Remarks
Defaults to false
.
ElementReference
The reference to the HTML element for this component.
public ElementReference ElementReference { get; }
Property Value
HideSpinButtons
For MudNumericField<T>, hides the spin buttons.
[Parameter]
public bool HideSpinButtons { get; set; }
Property Value
Remarks
Defaults to true
.
InputClassname
protected string InputClassname { get; }
Property Value
InputType
The type of input collected by this component.
[Parameter]
public InputType InputType { get; set; }
Property Value
Remarks
Defaults to Text. Represents a valid HTML5 input type.
InputTypeString
protected string InputTypeString { get; }
Property Value
MaxLines
The maximum vertical lines to display when AutoGrow is true
.
[Parameter]
public int MaxLines { get; set; }
Property Value
Remarks
Defaults to 0
. When 0
. this property is ignored.
NumericDownIcon
The icon to display for the Down
arrow button.
[Parameter]
public string NumericDownIcon { get; set; }
Property Value
Remarks
Defaults to KeyboardArrowDown.
NumericUpIcon
The icon to display for the Up
arrow button.
[Parameter]
public string NumericUpIcon { get; set; }
Property Value
Remarks
Defaults to KeyboardArrowUp.
OnClearButtonClick
Occurs when the clear button is clicked.
[Parameter]
public EventCallback<MouseEventArgs> OnClearButtonClick { get; set; }
Property Value
Remarks
OnDecrement
Occurs when the Down
arrow button is clicked.
[Parameter]
public EventCallback OnDecrement { get; set; }
Property Value
Remarks
Only occurs when InputType is Number. For numeric inputs, use the MudNumericField<T> component.
OnIncrement
Occurs when the Up
arrow button is clicked.
[Parameter]
public EventCallback OnIncrement { get; set; }
Property Value
Remarks
Only occurs when InputType is Number. For numeric inputs, use the MudNumericField<T> component.
OnMouseWheel
Occurs when a mouse wheel event is raised.
[Parameter]
public EventCallback<WheelEventArgs> OnMouseWheel { get; set; }
Property Value
Methods
BlurAsync()
When overridden, releases focus from this input.
public override ValueTask BlurAsync()
Returns
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
DisposeAsyncCore()
Called to dispose this instance.
protected override ValueTask DisposeAsyncCore()
Returns
FocusAsync()
When overridden, obtains focus for this input.
public override ValueTask FocusAsync()
Returns
HandleClearButtonAsync(MouseEventArgs)
protected virtual Task HandleClearButtonAsync(MouseEventArgs e)
Parameters
Returns
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnChange(ChangeEventArgs?)
protected Task OnChange(ChangeEventArgs? args)
Parameters
args
ChangeEventArgs
Returns
OnInput(ChangeEventArgs?)
protected Task OnInput(ChangeEventArgs? args)
Parameters
args
ChangeEventArgs
Returns
OnPaste(ClipboardEventArgs)
Paste hook for descendants.
protected virtual Task OnPaste(ClipboardEventArgs args)
Parameters
args
ClipboardEventArgs
Returns
SelectAsync()
When overridden, selects this input.
public override ValueTask SelectAsync()
Returns
SelectRangeAsync(int, int)
When overridden, selects a portion of the input.
public override ValueTask SelectRangeAsync(int pos1, int pos2)
Parameters
pos1
intThe index of the first character to select.
pos2
intThe index of the last character to select.
Returns
SetParametersAsync(ParameterView)
public override Task SetParametersAsync(ParameterView parameters)
Parameters
parameters
ParameterView
Returns
SetText(string?)
Set the Text to the specified value.
public Task SetText(string? text)
Parameters
text
stringThe new value.