Skip to main content

Control Components

Interactive control related components: ControlPanel, Input, RecommendedQuestions.

ControlPanel

Voice/text input control panel, supports mode switching.

Basic Usage

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

<template>
<PilotKit v-bind="props">
<ControlPanel />
</PilotKit>
</template>

Responsive Adaptation

📱 See Responsive Adaptation Guide

FeaturePCMobile
Input Width479px fixed100% adaptive
Button Size54-55px50px
LayoutCentered absolute positioningFull-width flex
Hangup ButtonOptional displayAlways display

Props

PropertyTypeDefaultDescription
variant'auto' | 'mobile' | 'desktop''auto'Display mode
classstring-Custom class name
styleCSSProperties-Custom style
mode'voice' | 'text'-Controlled mode
defaultMode'voice' | 'text''voice'Default mode
inputValuestring-Controlled input value
inputPlaceholderstring'请输入...'Input placeholder
inputDisabledbooleanfalseWhether to disable input
showHangupButtonbooleanfalseWhether to show hangup button

Events

EventTypeDescription
@modeChange(mode) => voidMode switch callback
@inputChange(value) => voidInput change callback
@send(value) => voidSend callback
@muteToggle(muted) => voidMute toggle callback
@hangup() => voidHangup callback

Slots

SlotDescription
defaultFully custom rendering
muteIconMute state icon
unmuteIconUnmute state icon
hangupIconHangup button icon
asrIconASR mode icon
keyboardIconKeyboard mode icon
sendIconSend button icon

Custom Rendering

<template>
<ControlPanel>
<!-- Fully custom control panel -->
<div class="my-control-panel">
<button>Custom Button</button>
</div>
</ControlPanel>
</template>

Style Customization

Class NameDescription
.apk-control-panelRoot container
.apk-control-panel--mobileMobile style
.apk-control-panel__innerInner container
.apk-control-panel__mode-btnMode switch button
.apk-control-panel__input-wrapperInput wrapper
.apk-control-panel__inputInput
.apk-control-panel__send-btnSend button
.apk-control-panel__mic-btnMicrophone button
.apk-control-panel__hangup-btnHangup button
.apk-control-panel__iconIcon
.apk-control-panel__icon-muteMute icon

Input

Independent text input component.

Basic Usage

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

<template>
<PilotKit v-bind="props">
<Input placeholder="Enter message..." />
</PilotKit>
</template>

Responsive Adaptation

FeaturePCMobile
Width479px100%
Height55px50px
Border Radius28px20px
Padding24px16px

Props

PropertyTypeDefaultDescription
variant'auto' | 'mobile' | 'desktop''auto'Display mode
classstring-Custom class name
styleCSSProperties-Custom style
modelValuestring-v-model binding value
defaultValuestring''Default value
placeholderstring'请输入...'Placeholder
disabledbooleanfalseWhether disabled
maxLengthnumber-Maximum length
autoFocusbooleanfalseWhether to auto focus
status'default' | 'error' | 'warning''default'Status
loadingbooleanfalseWhether loading
showSendIconbooleantrueWhether to show send icon

Events

EventTypeDescription
@update:modelValue(value) => voidv-model update
@textChange(value) => voidText change callback
@send(value) => voidSend callback
@focus(e) => voidFocus callback
@blur(e) => voidBlur callback
@keydown(e) => voidKeydown callback

Slots

SlotPropsDescription
default{value, setValue, handleSend, disabled, loading}Custom render
sendIcon-Custom send icon

Custom Rendering

<template>
<Input v-slot="{value, setValue, handleSend, disabled, loading}">
<div class="my-input">
<input
:value="value"
@input="e => setValue(e.target.value)"
:disabled="disabled"
/>
<button @click="handleSend" :disabled="loading">
Send
</button>
</div>
</Input>
</template>

Style Customization

Class NameDescription
.apk-inputRoot container
.apk-input--mobileMobile style
.apk-input--desktopDesktop style
.apk-input__fieldInput field
.apk-input__send-iconSend icon
.apk-input__loaderLoading indicator
.apk-input--errorError state
.apk-input--warningWarning state
.apk-input--disabledDisabled state
.apk-input--loadingLoading state

RecommendedQuestions

Recommended questions list component.

Basic Usage

<script setup lang="ts">
import {ref} from 'vue';
import {PilotKit, RecommendedQuestions, type IPilotKitRef} from '@bdky/aaas-pilot-kit-vue3-widget';
import '@bdky/aaas-pilot-kit-vue3-widget/styles.css';

const pilotKitRef = ref<IPilotKitRef | null>(null);

function handleQuestionClick(question: string) {
pilotKitRef.value?.input(question);
}
</script>

<template>
<PilotKit ref="pilotKitRef" v-bind="props">
<RecommendedQuestions
:questions="['Introduce yourself', 'What can you do?', 'Help me check my order']"
@questionClick="handleQuestionClick"
/>
</PilotKit>
</template>

Responsive Adaptation

FeaturePCMobile
LayoutHorizontal arrangementVertical arrangement
BackgroundSemi-transparent capsuleTransparent
Question ItemText + arrowCard style
TitleVisibleHidden by default
DividerVisibleHidden

Props

PropertyTypeDefaultDescription
variant'auto' | 'mobile' | 'desktop''auto'Display mode
classstring-Custom class name
styleCSSProperties-Custom style
questionsstring[][]Question list
titlestring'试试这样问:'Title text
showTitlebooleanfalseWhether to show title
showDividerbooleantrueWhether to show divider
expandedbooleanfalseWhether expanded

Events

EventTypeDescription
@questionClick(question: string) => voidQuestion click callback

Slots

SlotDescription
arrowIconCustom arrow icon

Style Customization

Class NameDescription
.apk-recommended-questionsRoot container
.apk-recommended-questions--mobileMobile style
.apk-recommended-questions__titleTitle
.apk-recommended-questions__dividerDivider
.apk-recommended-questions__listQuestion list
.apk-recommended-questions__itemQuestion item
.apk-recommended-questions__arrowArrow icon
.apk-recommended-questions__arrow-iconMobile arrow icon