Blocks
Block​
The Block
component is used for wrapping fields in BlockRepeater
, BlockEditor
or DiscriminatedBlocks
components.
- Component - simple
- Component - advanced
<Block discriminateBy="gallery" label="Gallery">
...
</Block>
<Block
discriminateBy="gallery"
label="Gallery"
description=""
alternate=""
>
...
</Block>
Props​
Prop | Description |
---|---|
| OptionallyVariableFieldValue Field to discriminate by. Required |
| ReactNode The label for the field. |
| ReactNode The description for the field. |
| ReactNode |
| Renders content of the component. |
Discriminated blocks​
The DiscriminatedBlocks
component is a wrapper for a block of content.
- Component - simple
- Component - advanced
<DiscriminatedBlocks>
...
</DiscriminatedBlocks>
<DiscriminatedBlocks
allowBlockTypeChange={true}
>
...
</DiscriminatedBlocks>
Props​
Prop | Description |
---|---|
| Renders content of the component. Required |
| boolean |
| Size |
| FormGroupLabelPosition |
| ReactNode |
| ReactNode The description for the field. |
| boolean |
getDiscriminatedBlock​
The getDiscriminatedBlock
function returns a block of content.
const discriminatedBlock = getDiscriminatedBlock(blocks, field)