ChoiceSchemaInputcomponent

ChoiceSchemaInput({ schema, value, ...props }: ChoiceSchemaInputProps): ReactElement
ParamType
propsChoiceSchemaInputProps
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 input picks 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. a CountrySchema'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} />