Union

Gives you the option choose between different component structures within a single block.

Features

  • ✅ Ideal for modular sections and programatic pages

  • ✅ Gives you the option choose between different component structures within a single block

  • ✅ Can have nested blocks

Constraints

Contraint

Description

Is required

Validates the input is filled.

Allow multiple

When checked, it enables listing multiple instances or components, but they still have to be of an allowed type.

Allowed union types

Limits the types of the union children.

Use cases

The Union type is a powerful block that enables you to create a space for a singular or multiple instances of the selected types. Think of it as an “OR” between the allowed types selected. For example, if you have a Union with allowed types “Code Group” and “Code Snippet”, the union child can be a “Code Group” instance OR a “Code Snippet” instance.

This makes it ideal for a bunch of use cases, including:

  1. Creating a “Sections” union block for your modular, programmatic pages (see example)

  2. Creating a conditional structure, such as “Section with Media“ in which the media part is a union of “either an image or a video”