Skip to main content

Select components

Select field#

The SelectField component renders a select field.

<SelectField
field="category"
label="Select category"
options="Category.name"
/>

Props#

PropDescription

field

string

The name of the column in Contember schema where to store data.

Required

label

ReactNode

The label for the field.

Required

options

string | { label: ReactNode, value: OptionallyVariableFieldValue, description: ReactNode, searchKeywords: string | undefined }[]

The options for the field. You can use query language to filter the entities.

Required

renderOption

undefined | (EntityAccessor) => ReactNode

A function that is called to render the option.

optionsStaticRender

undefined | ReactElement

A function that is called to render static the options.

Multi select field#

The MultiSelectField renders a select field with posibility to select multiple options.

<MultiSelectField field="tags" label="Select tags" options="Tag.name" />

Props#

PropDescription

field

string

The name of the column in Contember schema where to store data.

Required

label

ReactNode

The label for the field.

Required

options

string | { label: ReactNode, value: OptionallyVariableFieldValue, description: ReactNode, searchKeywords: string | undefined }[]

The options for the field. You can use query language to filter the entities.

Required