Child blocks in custom components
When you want your custom component to accept other blocks, configure your component with children. The following video demonstrates a custom tabs component that accepts Builder blocks as content. Each tab receives a unique block that the user drags and drops in.
Prerequisites
To get the most out of this tutorial, you should have the following:
- An app you've integrated with Builder
- Familiarity with using custom components
Basic child blocks example
The most fundamental use case is a basic container that accepts draggable content. This section demonstrates a hero component that users can drag and drop other blocks into.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
Place the childRequirements object inside registerComponent() after defaultChildren. With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
Place the childRequirements object inside registerComponent() after defaultChildren. With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
Place the childRequirements object inside registerComponent() after defaultChildren. With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
Place the childRequirements object inside registerComponent() after defaultChildren. With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
Place the childRequirements object inside registerComponent() after defaultChildren. With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
The component uses the <Blocks> component to create an editable region, and the Builder registration configures how the component appears and behaves in the Visual Editor.
Register your component and specify that it can accept children:
The component uses the <Blocks> component to create an editable region, and the Builder registration configures how the component appears and behaves in the Visual Editor.
Register your component and specify that it can accept children:
To add children to your Qwik custom component, use RegisteredComponent with defaultChildren.
The following example exports a const called customComponents, which specifies a component called MyFunComponent and has a default child Text block.
To allow only certain types of children, configure childRequirements to specify child types that it can receive. Here, it can only receive a Button, Text, or Image block.
This example uses Angular's ng-content to create an insertion point for child content. The customHeroInfo object registers the component with Builder, defining its name, available inputs, and default content, making it available in the Visual Editor.
Add CustomChildComponent to your routes in your app.routes.ts:
This example uses Angular's ng-content to create an insertion point for child content. The customHeroInfo object registers the component with Builder, defining its name, available inputs, and default content, making it available in the Visual Editor.
Add CustomChildComponent to your routes in your app.routes.ts:
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
Place the childRequirements object inside registerComponent() after defaultChildren. With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
Register the component with Builder, specifying that it can accept children:
Register your component with Builder to define how it appears and behaves in the Visual Editor. The registration configuration:
- Sets the component's name and input fields
- Enables child blocks with
canHaveChildren - Provides default content with
defaultChildren - Makes the component available in the Visual Editor's Insert tab
Setting child requirements
To allow only certain types of children, configure childRequirements:
With this configuration, the custom component only accepts Button, Text, or Image blocks.
To test your component, visit any Page in your web browser that renders this component.
The following video demonstrates adding children to custom components using a basic hero banner.
Single editable regions work well for basic components. However, more complex layouts often require multiple distinct areas for content. The next example covers how to create a two-column layout with separate editable regions.
Multiple named editable regions
A common need is having multiple distinct areas within a custom component where users can add content. This section covers an example shows how to create a two-column layout where each column is a separate editable region.
Two-column layout example
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses BuilderBlocks for each column, which requires these props:
parentElementIdto identify which Builder block owns the contentdataPathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses BuilderBlocks for each column, which requires these props:
parentElementIdto identify which Builder block owns the contentdataPathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses BuilderBlocks for each column, which requires these props:
parentElementIdto identify which Builder block owns the contentdataPathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
Fixed editable regions serve many use cases, but some components need more flexibility. When users need to add an arbitrary number of content areas, dynamic regions provide the solution. The next tabs component demonstrates this pattern.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses BuilderBlocks for each column, which requires these props:
parentElementIdto identify which Builder block owns the contentdataPathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses BuilderBlocks for each column, which requires these props:
parentElementIdto identify which Builder block owns the contentdataPathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
Sometimes you need components with multiple editable regions, each with different purposes or restrictions. Here's an example of a two-column layout component with several advanced features:
- Multiple editable regions — left and right columns
- Component restrictions — left column only allows Text and Image blocks
- Configurable column widths
- Custom styling and layout options
The component uses <Blocks> for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
Register the component with Builder:
Sometimes you need components with multiple editable regions, each with different purposes or restrictions. Here's an example of a two-column layout component with several advanced features:
- Multiple editable regions — left and right columns
- Component restrictions — left column only allows Text and Image blocks
- Configurable column widths
- Custom styling and layout options
The component uses <Blocks> for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
Register the component with Builder:
The component uses the Blocks component for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain only Text and Image blocks
- A right column that can contain any Builder blocks
The component uses Builder's Blocks component for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
Add EditableRegionsComponent to your routes in app.routes.ts:
The following video demonstrates adding two editable regions by creating two column layout :
The component uses Builder's Blocks component for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
Add EditableRegionsComponent to your routes in app.routes.ts:
The following video demonstrates adding two editable regions by creating two column layout :
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses BuilderBlocks for each column, which requires these props:
parentElementIdto identify which Builder block owns the contentdataPathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
This example shows how to create a layout component with two distinct editable regions. Users can add different content to each column independently in the Visual Editor.
The component uses Blocks for each column, which requires these props:
parentto identify which Builder block owns the contentpathto store each column's content in the correct locationblocksto manage the actual content for each column
The component registration defines two editable regions using uiBlocks:
- A left column that can contain any Builder blocks
- A right column that can contain any Builder blocks
Users can drag and drop different Builder components into each column independently, creating flexible two-column layouts.
Dynamic slots (regions)
For more complex use cases, you might need multiple editable regions or slots that can be added dynamically. This tabs example demonstrates how to create a component where users can add new tabs, each with its own editable content area.
Dynamic tabs example
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
BuilderBlocks - Uses
parentElementIdto connect the blocks to the parent component - Uses
dataPathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A name field for the tab label
- A blocks field for the tab's content, using the
uiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
BuilderBlocks - Uses
parentElementIdto connect the blocks to the parent component - Uses
dataPathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A name field for the tab label
- A blocks field for the tab's content, using the
uiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
BuilderBlocks - Uses
parentElementIdto connect the blocks to the parent component - Uses
dataPathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A name field for the tab label
- A blocks field for the tab's content, using the
uiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
BuilderBlocks - Uses
parentElementIdto connect the blocks to the parent component - Uses
dataPathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A name field for the tab label
- A blocks field for the tab's content, using the
uiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
BuilderBlocks - Uses
parentElementIdto connect the blocks to the parent component - Uses
dataPathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A name field for the tab label
- A blocks field for the tab's content, using the
uiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
Here's a more complex example showing how to build a tabs component where both the tab labels and content are editable.
The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
<Blocks> - Uses Vue's reactive state to manage the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Register the component with Builder:
Here's a more complex example showing how to build a tabs component where both the tab labels and content are editable.
The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
<Blocks> - Uses Vue's reactive state to manage the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Register the component with Builder:
The CustomTabs component renders a tab-based layout with editable regions within each tab. The <Blocks> component renders the child blocks for the active tab and facilitates the editing and customization of those blocks within the Visual Editor.
The component:
- Creates a tab navigation interface using Angular's
*ngFordirective - Provides an editable region within each tab using the
Blockscomponent - Uses Angular's property binding to manage the active tab state
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Add AdancedChildComponent to your routes in app.routes.ts:
The following video demonstrates adding advanced sub-components with editable regions:
The component:
- Creates a tab navigation interface using Angular's
*ngFordirective - Provides an editable region within each tab using the
Blockscomponent - Uses Angular's property binding to manage the active tab state
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Add AdancedChildComponent to your routes in app.routes.ts:
The following video demonstrates adding advanced sub-components with editable regions:
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
BuilderBlocks - Uses
parentElementIdto connect the blocks to the parent component - Uses
dataPathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A name field for the tab label
- A blocks field for the tab's content, using the
uiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
This example shows how to create a tabs component where users can add new tabs dynamically and customize the content of each tab. The component:
- Creates a tab navigation interface where users can switch between tabs
- Provides an editable region within each tab using
Blocks - Uses
parentto connect the blocks to the parent component - Uses
pathto specify where the tab's content is stored - Uses
blocksto contain the actual content for the active tab
The component registration defines an array input for the tabs, where each tab includes:
- A
namefield for the tab label - A
blocksfield for the tab's content, using theuiBlockstype
Users can add new tabs and customize their content directly in the Visual Editor.
What's next
To customize your components even further, leverage Builder's Input Types.
For more details on child-related options when working with child components, visit the canHaveChildren, childRequirements, and defaultChildren sections of the registerComponent() documentation.
For more examples of custom components with multiple sets of children, visit: