ChoiceSchemaInputcomponent
ChoiceSchemaInput({ schema, value, ...props }: ChoiceSchemaInputProps): ReactElement| Param | Type | |
|---|---|---|
props | ChoiceSchemaInputProps | Props for ChoiceSchemaInput, the ChoiceSchema input variant. required |
| Return | |
|---|---|
ReactElement | A ChoiceRadioInputs or SelectInput element bound to the schema. |
Show a choice input for a ChoiceSchema — radio inputs or a select.
- The schema's
inputpicks the control:"radio"for radio inputs,"select"for a select. - The value is normalised through the schema's
get(), so invalid or sentinel values (e.g. aCountrySchema's"detect") resolve to a real option or fall back to the placeholder rather than mis-selecting the first option.
Examples
<ChoiceSchemaInput name="role" schema={ROLE} />