Mudblazor

Community Support

Discord

Gitter

Tools and resources

TryMudBlazor

Templates


Switch to Blazor wasm
Toggle light/dark theme
GitHub repository
Toggle right-to-left/left-to-right

Community Support

Discord

Gitter

Tools and resources

TryMudBlazor

Templates

MudTextField<T>

API documentation.

Check out the Examples for this component.

Properties

Name Type Default Description
Placeholder String null The short hint displayed in the input before the user enters a value.
Label String null If string has value the label text will be displayed in the input, and scaled down at the top if the input has value.
DebounceInterval Double 0 Interval to be awaited in milliseconds before changing the Text value
OnDebounceIntervalElapsed EventCallback<String> callback to be called when the debounce interval has elapsed receives the Text as a parameter
Disabled Boolean False If true, the input element will be disabled.
ReadOnly Boolean False If true, the input will be read only.
FullWidth Boolean False If true, the input will take up the full width of its container.
Immediate Boolean False If true, the input will update the Value immediately on typing. If false, the Value is updated only on Enter.
DisableUnderLine Boolean False If true, the input will not have an underline.
HelperText String null The HelperText will be displayed below the text field.
AdornmentIcon String null Icon that will be used if Adornment is set to Start or End.
AdornmentText String null Text that will be used if Adornment is set to Start or End, the Text overrides Icon.
Adornment Adornment Adornment.None Sets Start or End Adornment if not set to None.
AdornmentColor Color Color.Default The color of the adornment if used. It supports the theme colors.
IconSize Size Size.Small Sets the Icon Size.
OnAdornmentClick EventCallback<MouseEventArgs> Button click event if set and Adornment used.
InputType InputType InputType.Text Type of the input element. It should be a valid HTML5 input type.
Variant Variant Variant.Text Variant to use.
Margin Margin Margin.None Will adjust vertical spacing.
AutoFocus Boolean False If true the input will focus automatically
Lines Int32 1 A multiline input (textarea) will be shown, if set to more than one line.
Text String null
TextChanged EventCallback<String>
OnBlur EventCallback<FocusEventArgs>
OnKeyDown EventCallback<KeyboardEventArgs>
KeyDownPreventDefault Boolean False
OnKeyPress EventCallback<KeyboardEventArgs>
KeyPressPreventDefault Boolean False
OnKeyUp EventCallback<KeyboardEventArgs>
KeyUpPreventDefault Boolean False
ValueChanged EventCallback<T> Fired when the Value property changes.
Value T null The value of this input element. This property is two-way bindable.
Format String null Conversion format parameter for ToString(), can be used for formatting primitive types, DateTimes and TimeSpans
Required Boolean False If true, this form input is required to be filled out.
RequiredError String "Required" Set an error text that will be displayed if the input is not filled out but required!
ErrorText String null The ErrorText that will be displayed if Error true
Error Boolean False If true, the label will be displayed in an error state.
Converter Converter<T, String>
Culture CultureInfo
Validation Object null A validation func or a validation attribute. Supported types are: Func<T, bool> ... will output the standard error message "Invalid" if false Func<T, string> ... outputs the result as error message, no error if null Func<T, IEnumerable< string >> ... outputs all the returned error messages, no error if empty Func<T, Task< bool >> ... will output the standard error message "Invalid" if false Func<T, Task< string >> ... outputs the result as error message, no error if null Func<T, Task<IEnumerable< string >>> ... outputs all the returned error messages, no error if empty System.ComponentModel.DataAnnotations.ValidationAttribute instances
For Expression<Func<T>> null Specify an expression which returns the model's field for which validation messages should be displayed. Currently only string fields are supported.
Class String null User class names, separated by space
Style String null User styles, applied on top of the component's own classes and styles
Tag Object null Use Tag to attach any user data object to the component for your convenience.
UserAttributes Dictionary<String, Object> UserAttributes carries all attributes you add to the component that don't match any of its parameters. They will be splatted onto the underlying HTML tag.
An error has occurred. This application may no longer respond until reloaded. Reload 🗙