Skip to main content

Editor

Block editor​

The BlockEditor component is the main component of the editor. It is responsible for rendering the editor's toolbar and the editor's content.

<BlockEditor
contentField="json"
field="content.blocks"
label="Content"
sortableBy="order"
/>

Props​

PropDescription

contentField

string

Field name of string field in entities referenced by field prop.

Required

field

string

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

Required

label

ReactNode

The label for the field.

Required

sortableBy

undefined | string

The name of the column in Contember schema that is used to sort the options.

Required

referencesField

undefined | string | SugaredRelativeEntityList

Field name of the references.

referenceDiscriminationField

undefined | string | SugaredRelativeSingleField

Field name of the reference discrimination.

inlineButtons

undefined | ToolbarButtonSpec[] | ToolbarButtonSpec[][]

Buttons to be displayed in the inline toolbar.

blockButtons

undefined | BlockHoveringToolbarConfig[] | BlockHoveringToolbarConfig[][] |

Buttons to be displayed in the block toolbar.

augmentEditor

undefined | ((baseEditor: BaseEditor) => BaseEditor)

Function to be called when the editor is created.

Block​

The Block component is responsible for rendering the editor's content.

<Block discriminateBy="gallery" label="Gallery"> 
...
</Block>

Props​

PropDescription

discriminateBy

OptionallyVariableFieldValue

Field to discriminate by.

Required

label

ReactNode

The label for the field.

description

ReactNode

The description for the field.

alternate

ReactNode

children

Renders content of the component.