Skip to main content

DiscriminatedBlocks

Renders different blocks based on a value in a discrimination field.
<DiscriminatedBlocks label="Link" field="type">
<Block discriminateBy="article" label="Articles">
<SelectField options="Article.slug" field="article" label="Article" />
</Block>
<Block discriminateBy="url" label="External link">
<TextField label="Url" field="url" />
</Block>
</DiscriminatedBlocks>
DiscriminatedBlocksProps
DiscriminatedBlocksProps
Intersection of
DiscriminatedBlocksProps
allowBlockTypeChange
boolean
children*
React.ReactNode
FieldContainerProps
FieldContainerProps
Intersection of
FieldContainerProps
children*
React.ReactNode
className
string
description
React.ReactNode
direction
StackProps["direction"]
display
| "inline"| "block"
evenly
StackProps["evenly"]
gap
StackProps["gap"]
horizontal
StackProps["horizontal"]
label*
React.ReactNode
labelDescription
React.ReactNode
labelPosition
FieldContainerLabelPosition
required
boolean
reverse
StackProps["reverse"]
size
Size
style
React.CSSProperties
useLabelElement
boolean
width
| "column"| "fluid"| "none"
ErrorListProps
ErrorListProps
errors
FieldErrors
SugaredRelativeSingleField
SugaredRelativeSingleField
Intersection of
UnsugarableRelativeSingleField
UnsugarableRelativeSingleField
UnsugarableLeafField
UnsugarableLeafField
Intersection of
UnsugarableFieldEventListeners
UnsugarableFieldEventListeners
UnsugarableFieldEventListeners
onBeforeUpdate
FieldEventListenerValue<"beforeUpdate", FieldValue>
onInitialize
FieldEventListenerValue<"initialize", FieldValue>
onUpdate
FieldEventListenerValue<"update", FieldValue>
UnsugarableLeafField
defaultValue
OptionallyVariableFieldValue
isNonbearing
boolean
SugaredRelativeSingleField
field*
| string| SugarableRelativeSingleField