Skip to main content

Form fields

Checkbox field

The CheckboxField component is a wrapper for the Checkbox component.

Loading...

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

defaultValue

Scalar

The default value of the field.

format

undefined | (value: Scalar ) => ReactNode

A function that formats the value as a ReactNode. The function is called with the value as the first argument.

isNonbearing

undefined | boolean

If true, the field is non-bearing.

key

undefined | Key | null

The key of the field. If the key is not specified, the key is generated from the field name.

onBeforeUpdate

undefined | (value: Scala}) => Scalar

A function that is called before the value is updated.

onInitialize

undefined | (value: Scalar) => Scalar

A function that is called when the field is initialized.

onUpdate

undefined | (value: Scalar) => Scalar

A function that is called when the value is updated.

Color field

Loading...

Date field

The DateField component renders date input for editing date.

Loading...

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

Date time field

The DateTimeField component renders a date&time field for editing date and time.

Loading...

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

Field

The Field components renders value of the field.

<Field field="myField" />

Props

PropDescription

field

string

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

Required

defaultValue

Scalar

The default value of the field.

format

undefined | (value: Scalar ) => ReactNode

A function that formats the value as a ReactNode. The function is called with the value as the first argument.

isNonbearing

undefined | boolean

If true, the field is non-bearing.

key

undefined | Key | null

The key of the field. If the key is not specified, the key is generated from the field name.

onBeforeUpdate

undefined | (value: Scala}) => Scalar

A function that is called before the value is updated.

onInitialize

undefined | (value: Scalar) => Scalar

A function that is called when the field is initialized.

onUpdate

undefined | (value: Scalar) => Scalar

A function that is called when the value is updated.

Hidden field

The HiddenField components is used to include data into the form but hide them from user.

<HiddenField field="myField" />

Props

PropDescription

field

string

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

Required

defaultValue

Scalar

The default value of the field.

key

undefined | Key | null

The key of the field. If the key is not specified, the key is generated from the field name.

MultiSelect field

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

Loading...

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

Rich text field

The RichTextField component renders a rich text field. The text field is used for rich text editing.

Loading...

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

inlineButtons

undefined | ToolbarButtonSpec[] | ToolbarButtonSpec[][]

Buttons to be displayed in the inline toolbar.

Select field

The SelectField component renders a select field.

Loading...

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.

Text area field

The TextAreaField component renders a text area field. The text field is used for basic string editing and has no rich text editing capabilities.

Loading...

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

Text field

The TextField component renders a text field. The text field is used for basic string editing and has no rich text editing capabilities.

Loading...

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

about

undefined | string

A description of the field. The description is displayed in the tooltip.

accessKey

undefined | string

The access key of the field used to setup keyboard shortcut for the field. More info: MDN Access Key

autoFocus

boolean

Whether the field should be focused on mount. The last field with autoFocus property set to true will be focused, If there are multiple ones.

allowNewlines

undefined | boolean

If true, the field allows newlines.

description

ReactNode

The description for the field.