Builder

BannerLayout

Overview

The TsBannerLayout component is a flexible layout with three customizable blocks: leftBlocks, rightTopBlocks, and rightBottomBlocks. It supports drag-and-drop functionality in Builder.io, allowing seamless integration of custom components into each block.

Component Code

<template>
  <div class="flex items-stretch" :id="`three-banner-layout-${random_id}`">
    <div class="items-stretch grow">
        <Blocks
            class="w-full"
            :parent="props.builderBlock?.id"
            :path="`component.options.leftBlocks`"
            :blocks="props.leftBlocks"
        />
    </div>
    <div class="min-w-[350px]">

        <Blocks
            class="w-full"
            :parent="props.builderBlock?.id"
            :path="`component.options.rightTopBlocks`"
            :blocks="props.rightTopBlocks"
        />

        <Blocks
            class="w-full"
            :parent="props.builderBlock?.id"
            :path="`component.options.rightBottomBlocks`"
            :blocks="props.rightBottomBlocks"
        />

    </div>
  </div>
</template>

<script setup lang="ts">
import { Blocks } from '@builder.io/sdk-vue';

type Props = {
  builderBlock?: object;
  leftBlocks?: any[];
  rightTopBlocks?: any[];
  rightBottomBlocks?: any[];
}

const props = defineProps<Props>();

const random_id = ref('')

onMounted(() => {
  random_id.value = useRandomUUID()
})
</script>

Usage

  1. Go to the insert tab.
  2. Search BannerLayout in search bar.
  3. Hold BannerLayout component & drag where you want to use.
  4. Use any component and drag inside the BannerLayout blocks in which you want to add.

Props

NameTypeDefaultDescription
builderBlockobject""builderBlock is used for builderBlock object which set by default when dragging BannerLayout in builder visual editor.
leftBlocksany[]""leftBlocks is used to add block in left section of BannerLayout and It's hidden from the visual editor.
rightTopBlocksany[]""rightTopBlocks is used to add block in left section of BannerLayout and It's hidden from the visual editor.
rightBottomBlocksany[]""rightBottomBlocks is used to add block in left section of BannerLayout and It's hidden from the visual editor.

Copyright © 2026