Import
Basic Usage
Props
The variant to use.
The value of the
input element, required for a controlled component.The default value. Use when the component is not controlled.
The label content.
The short hint displayed in the
input before the user enters a value.Type of the
input element. It should be a valid HTML5 input type.The color of the component. Supports both default and custom theme colors.
The size of the component.
If
true, the component is disabled.If
true, the label is displayed in an error state.If
true, the label is displayed as required and the input element is required.If
true, the input will take up the full width of its container.If
true, a textarea element is rendered instead of an input.Number of rows to display when multiline option is set to true.
Maximum number of rows to display when multiline option is set to true.
Minimum number of rows to display when multiline option is set to true.
The helper text content.
This prop helps users to fill forms faster, especially on mobile devices. The name can be confusing, as it’s more like an autofill.
If
true, the input element is focused during the first mount.Render a Select element while passing the Input element to
Select as input parameter. If this option is set you must pass the options of the select as children.Callback fired when the value is changed. You can pull out the new value by accessing
event.target.value (string).Callback fired when the input loses focus.
Callback fired when the input receives focus.
Pass a ref to the
input element.The system prop that allows defining system overrides as well as additional CSS styles.
API Reference
- TextField API
- Inherits FormControl API