Field.Root
Groups the parts and owns field state. Renders <div>.
| Prop | Type | Default | Description |
|---|
name | string | — | Name submitted with the form; overrides the control's name. |
disabled | boolean | false | Disables the control and marks every part. |
invalid | boolean | false | Forces the invalid state, e.g. for server errors. |
validationMode | 'onSubmit' | 'onBlur' | 'onChange' | "onSubmit" | When validation first runs. After that the field revalidates on every change. |
| Data attribute | Present when |
|---|
data-disabled | the field is disabled |
data-valid | validated and valid |
data-invalid | validated and invalid, or forced invalid |
data-dirty | the value differs from the initial value |
data-touched | the control has been blurred |
data-filled | the control has a value |
data-focused | the control is focused |
Field.Label
Labels the control (for / aria-labelledby). Renders <label>.
| Data attribute | Present when |
|---|
data-disabled | the field is disabled |
data-valid | validated and valid |
data-invalid | validated and invalid, or forced invalid |
data-dirty | the value differs from the initial value |
data-touched | the control has been blurred |
data-filled | the control has a value |
data-focused | the control is focused |
Field.Description
Help text, referenced by aria-describedby. Renders <p>.
| Data attribute | Present when |
|---|
data-disabled | the field is disabled |
data-valid | validated and valid |
data-invalid | validated and invalid, or forced invalid |
data-dirty | the value differs from the initial value |
data-touched | the control has been blurred |
data-filled | the control has a value |
data-focused | the control is focused |
Field.Error
Shown while the field is invalid and `match` applies; referenced by aria-describedby while shown. Renders <div>.
| Prop | Type | Default | Description |
|---|
match | boolean | 'valueMissing' | 'typeMismatch' | 'tooShort' | 'tooLong' | 'patternMismatch' | 'rangeUnderflow' | 'rangeOverflow' | 'stepMismatch' | 'badInput' | 'customError' | — | Which error shows this message. Unset or true: any. Angular also accepts forms error keys (required, email, minlength…). |
| Data attribute | Present when |
|---|
data-valid | animating out after the field became valid |
data-invalid | validated and invalid, or forced invalid |
data-dirty | the value differs from the initial value |
data-touched | the control has been blurred |
data-filled | the control has a value |
data-focused | the control is focused |
data-starting-style | animating in |
data-ending-style | animating out |