ChoiceFieldComponentProps
What a Choice component receives: everything every field gets, plus what a Lookup needs. A component
written against FieldComponentProps<ChoiceField> alone is still a valid override; it simply ignores these.
Extends
Section titled “Extends”Properties
Section titled “Properties”disabled
Section titled “disabled”disabled:
boolean
Inherited from
Section titled “Inherited from”error:
string|null
A validation message for this field, or null. Render it and reference it via aria-describedby.
Inherited from
Section titled “Inherited from”existing?
Section titled “existing?”
optionalexisting?:boolean|null
A Lookup’s companion answer: true picked from the options, false typed, null not answered.
field:
ChoiceField
Inherited from
Section titled “Inherited from”id:
string
Stable, unique per field — wire this to both the control’s id and its label’s htmlFor.
Inherited from
Section titled “Inherited from”lookup?
Section titled “lookup?”
optionallookup?:LookupSource
Searches a Lookup’s options as the respondent types. Absent: the field is a plain text input.
name:
string
The field’s raw SubmissionKey — wire this to the control’s name (spec
77-public-form-progressive-enhancement). Deliberately not id: id is scoped to one rendered
form instance (${baseId}-${key}), but a native form submission needs name to be the exact
key the server expects, with no per-form id-to-key translation required to read it back.
Inherited from
Section titled “Inherited from”onChange
Section titled “onChange”onChange: (
value) =>void
Parameters
Section titled “Parameters”string | number | string[] | null
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”onExistingChange?
Section titled “onExistingChange?”
optionalonExistingChange?: (existing) =>void
Report the companion answer; the form stores it as <key>-existing.
Parameters
Section titled “Parameters”existing
Section titled “existing”boolean | null
Returns
Section titled “Returns”void
value:
string|number|string[] |null