Labels for TextFields should describe what the field is. Labels should not be followed by a colon. Placeholder text should describe the specifics about formatting or examples for the input text. Placeholder text is optional, and should never be used to replace a label.
Required TextFields should have the required attribute. Optional TextFields should be clearly marked with "(optional)".
Try not to include too many optional fields, as it will make the form harder to comprehend and complete for the user.
placeholder
value
error
success
search
fullWidth
type="textarea"
with adornments
htmlFor & id
auto generated id
with adornments
Property | Type | Required | Default | Description |
---|---|---|---|---|
type | Enum | false | text | HTML prop to be applied to the input |
value | Node | false | - | HTML prop for the current value of the input |
error | Bool | false | - | The form control should show an error |
success | Bool | false | - | The form control should show success |
search | Bool | false | - | Option to display a magnifying glass icon and clear button to the input. |
onRequestClear | Func | false | - | Callback when Search clear button is clicked |
fullWidth | Bool | false | - | Make the TextField 100% width |
minimal | Bool | false | - | Display prop to style the TextField with a simplified UI |
horizontal | Bool | false | - | TextField and label should appear side by side instead of stacked |
id | String | false | - | HTML prop for the TextField, works together with a label's `for` prop |
name | String | false | - | HTML prop to name the form element |