MtTextField component provides a single-line text input with various features like validation, copying, and character limits.
Import
Props
The value of the text field.
A label for your text field. Usually used to guide the user what value this field controls.
A placeholder text being displayed if no value is set.
A text that helps the user to understand what this field does.
The size of the text field.
Toggles the copy function of the text field.
If set to true the tooltip will change on successful copy.
Determines if the field is disabled.
Determines if the field is required.
If set to a value a character counter will be displayed.
An error in your business logic related to this field.
Toggles the inheritance visualization.
Determines if the field is inheritable.
Determines the active state of the inheritance toggle.
The name attribute for the input.
Events
Emitted when the text value changes.
Emitted when input loses focus.
Emitted when the field gains focus.
Emitted when the field loses focus.
Emitted when inheritance is restored.
Emitted when inheritance is removed.
Slots
Content displayed before the input.
Content displayed after the input.
Additional hint content below the field.
Usage
Basic Text Field
With Character Limit
Copyable Field
Small Size
With Prefix and Suffix
Required Field
Disabled Field
Accessibility
- Uses native text input for proper behavior
- Label properly associated with input via
forattribute - Error messages linked via aria-describedby
- Character count announced to screen readers
- Focus visible outline for keyboard navigation
- Placeholder text accessible
- Required fields marked with asterisk