Primitive
Field
Gives one form control its label, description and error, and wires them for assistive technology.
When to use
Use it around every Input that has a visible label. Use Input alone only where a visible label cannot fit, with an aria-label.
States
Enter the name exactly as it appears on the subscription agreement.
Limited partners copy this into the wire memo.
Use 20 or fewer characters, or bank portals cut the reference short.
Enter the bank name as it appears on the wire instructions, without abbreviations, so incoming wires match the capital call.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| Field.Root | part | Default – | Wraps one control and its parts, in a column. Takes Base UI's Field.Root props, below. |
| invalid | boolean | Default false | A known error, such as one the server returned. Marks the control aria-invalid and shows Field.Error. |
| disabled | boolean | Default false | Disables the control and dims the label. |
| name | string | Default – | The name the value is submitted under; wins over the control's. |
| validationMode | "onSubmit" | "onBlur" | "onChange" | Default "onBlur" | When the browser's checks run. onBlur checks the control when it loses focus and works in a plain form. Use onChange when the answer should come as people type, such as whether a reference is free. onSubmit works only inside a Base UI Form, which Marker does not have yet. |
| validate | (value, formValues) => string | string[] | null | Default – | A custom check that returns the message. A function, so only a client component can pass it. |
| className | string | Default – | Places the field: margin, width, grid placement. Never its look. |
| Field.Label | part, required | Default – | The control's visible name, a <label>. Shows an asterisk, hidden from assistive technology, when the control is required. |
| Field.Description | part | Default – | Help for the control, read with it as its description. |
| Field.Error | part | Default – | What is wrong and how to fix it. Shows when the root is invalid, when its match check fails, or, with no match, when any check fails. Announced politely when it appears after the page loads. |
| match | boolean | keyof ValidityState | Default – | On Field.Error: the check this message is for, such as "valueMissing" or "typeMismatch". Without children, the browser's message shows. |