Skip to main content

Layout Components

Layout helper components: Layout, FillAdapter.

Layout

Flex layout container component, provides flexible layout capabilities.

Basic Usage

<script setup lang="ts">
import {PilotKit, Layout, ConversationList, ControlPanel} from '@bdky/aaas-pilot-kit-vue3-widget';
import '@bdky/aaas-pilot-kit-vue3-widget/styles.css';
</script>

<template>
<PilotKit v-bind="props">
<Layout direction="vertical" hCenter>
<ConversationList />
<ControlPanel />
</Layout>
</PilotKit>
</template>

Vertical Center Layout

<template>
<Layout direction="vertical" vCenter hCenter>
<div>Vertically and horizontally centered content</div>
</Layout>
</template>

Horizontal Layout

<template>
<Layout direction="horizontal" vCenter>
<div>Left content</div>
<FillAdapter />
<div>Right content</div>
</Layout>
</template>

Props

PropertyTypeDefaultDescription
direction'horizontal' | 'vertical''horizontal'Layout direction
fill'full' | 'auto''full'Fill mode
vCenterbooleanfalseVertical center
hCenterbooleanfalseHorizontal center
classstring-Custom class name
styleCSSProperties-Custom style

fill Property Description

ValueDescription
'full'Fill parent container (width: 100%, height: 100%)
'auto'Size determined by content

Style Customization

Class NameDescription
.apk-layoutRoot container
.apk-layout--horizontalHorizontal layout
.apk-layout--verticalVertical layout
.apk-layout--v-centerVertical center
.apk-layout--h-centerHorizontal center
.apk-layout-fill--fullFull fill mode
.apk-layout-fill--autoAuto size mode

FillAdapter

Adaptive fill component, works with Layout to occupy remaining space.

Basic Usage

<script setup lang="ts">
import {Layout, FillAdapter, ControlPanel} from '@bdky/aaas-pilot-kit-vue3-widget';
import '@bdky/aaas-pilot-kit-vue3-widget/styles.css';
</script>

<template>
<Layout direction="vertical">
<FillAdapter /> {/* Occupy remaining space above */}
<ControlPanel /> {/* Fixed at bottom */}
</Layout>
</template>

Multiple FillAdapter

You can use multiple FillAdapter components with different flex values:

<template>
<Layout direction="vertical">
<FillAdapter :flex="1" /> {/* Occupy 1 part */}
<div>Middle content</div>
<FillAdapter :flex="2" /> {/* Occupy 2 parts */}
</Layout>
</template>

Props

PropertyTypeDefaultDescription
flexnumber1Flex growth factor
classstring-Custom class name
styleCSSProperties-Custom style

Adaptive Direction

FillAdapter automatically detects parent Layout direction:

  • Vertical layout: Occupy vertical space (minHeight: 0)
  • Horizontal layout: Occupy horizontal space (minWidth: 0)

Using Composable

FillAdapter uses useLayout Composable to get parent Layout direction:

<script setup lang="ts">
import {useLayout} from '@bdky/aaas-pilot-kit-vue3-widget';

const {direction} = useLayout();
</script>

<template>
<div
:style="{
flex: 1,
...(direction === 'vertical'
? {minHeight: 0}
: {minWidth: 0})
}"
/>
</template>

Style Customization

Class NameDescription
.apk-fill-adapterRoot container

Typical Layout Examples

Digital Employee Standard Layout

<script setup lang="ts">
import {
PilotKit,
Layout,
FillAdapter,
ConversationList,
RecommendedQuestions,
Subtitle,
ControlPanel
} from '@bdky/aaas-pilot-kit-vue3-widget';
</script>

<template>
<PilotKit v-bind="props">
<Layout direction="vertical" hCenter>
<!-- Top: Occupy remaining space, digital human avatar displays here -->
<FillAdapter />

<!-- Middle: Conversation list -->
<ConversationList />

<!-- Middle: Recommended questions -->
<RecommendedQuestions
:questions="['Question 1', 'Question 2']"
:style="{marginBottom: '10px'}"
/>

<!-- Bottom: Subtitle -->
<Subtitle :style="{marginBottom: '10px'}" />

<!-- Bottom: Control panel -->
<ControlPanel :style="{marginBottom: '30px'}" />
</Layout>
</PilotKit>
</template>

Mobile Adaptation Layout

<script setup lang="ts">
import {
PilotKit,
Layout,
FillAdapter,
ConversationList,
Subtitle,
ControlPanel,
useIsMobile
} from '@bdky/aaas-pilot-kit-vue3-widget';

const isMobile = useIsMobile();
</script>

<template>
<PilotKit v-bind="props">
<Layout direction="vertical" hCenter>
<FillAdapter />

<!-- Show conversation list on mobile, show subtitle on PC -->
<ConversationList v-if="isMobile" />
<Subtitle v-else expandable @expand="handleExpand" />

<ControlPanel />
</Layout>
</PilotKit>
</template>