Skip to main content

Overlay Components

Overlay related components: StartupScreen, LoadingOverlay, StatusOverlay.

StartupScreen

Startup guide page component, used for scenarios requiring manual user activation (e.g., iOS iframe).

Basic Usage

import {useState} from 'react';
import {PilotKit, StartupScreen} from '@bdky/aaas-pilot-kit-react-widget';
import '@bdky/aaas-pilot-kit-react-widget/styles.css';

function App() {
const [showStartup, setShowStartup] = useState(false);

return (
<PilotKit
onNeedManualActivation={() => setShowStartup(true)}
{...props}
>
<StartupScreen
show={showStartup}
title="Start Conversation"
buttonText="Activate"
avatar={<img src="/avatar.jpg" alt="" />}
hintText="For better recognition results, please experience in a quiet environment"
onReady={() => setShowStartup(false)}
/>
</PilotKit>
);
}

Props

PropertyTypeDefaultDescription
showbooleanfalseWhether to show
classNamestring-Custom class name
styleCSSProperties-Custom style
backgroundUrlstring-Background image URL
titlestring'Start Conversation'Title
buttonTextstring'Start'Button text
hintTextstring-Hint text
avatarReactNode-Avatar element
onReady() => void-Activation success callback

Custom Rendering

<StartupScreen show={showStartup}>
{({onStart, isActivating}) => (
<div className="my-startup">
<h1>Welcome</h1>
<button onClick={onStart} disabled={isActivating}>
{isActivating ? 'Activating...' : 'Start Experience'}
</button>
</div>
)}
</StartupScreen>

Style Customization

Class NameDescription
.apk-startup-screen-wrapperOuter container
.apk-startup-screenInner container
.apk-startup-screen__contentContent area
.apk-startup-screen__avatar-wrapperAvatar wrapper
.apk-startup-screen__avatar-outerAvatar outer layer
.apk-startup-screen__titleTitle
.apk-startup-screen__hintHint text
.apk-startup-screen__buttonButton

LoadingOverlay

Loading overlay component.

Basic Usage

import {useState} from 'react';
import {PilotKit, LoadingOverlay} from '@bdky/aaas-pilot-kit-react-widget';
import '@bdky/aaas-pilot-kit-react-widget/styles.css';

function App() {
const [showLoading, setShowLoading] = useState(true);

return (
<PilotKit onReady={() => setShowLoading(false)} {...props}>
<LoadingOverlay
show={showLoading}
title="Calling"
description="Connecting to digital employee..."
avatar={<img src="/avatar.jpg" alt="" />}
/>
</PilotKit>
);
}

Props

PropertyTypeDefaultDescription
showbooleanfalseWhether to show
classNamestring-Custom class name
styleCSSProperties-Custom style
backgroundUrlstring-Background image URL
titlestring'Calling'Title
descriptionstring''Description text
avatarReactNode-Avatar element (with breathing animation)

Style Customization

Class NameDescription
.apk-loading-overlay-wrapperOuter container
.apk-loading-overlayInner container (frosted glass effect)
.apk-loading-overlay__contentContent area
.apk-loading-overlay__avatar-wrapperAvatar wrapper (with pulse animation)
.apk-loading-overlay__avatar-outerAvatar outer layer
.apk-loading-overlay__textTitle text
.apk-loading-overlay__tipDescription text

Animation

Avatar wrapper has pulse breathing animation, implemented through CSS @keyframes apk-calling-pulse.


StatusOverlay

Generic status overlay component, used for displaying busy, timeout, and other states.

Basic Usage

import {useState} from 'react';
import {PilotKit, StatusOverlay} from '@bdky/aaas-pilot-kit-react-widget';
import '@bdky/aaas-pilot-kit-react-widget/styles.css';

function App() {
const [showBusy, setShowBusy] = useState(false);

return (
<>
{showBusy ? (
<StatusOverlay
show
message="Sorry, I'm busy right now, please try again later"
buttonText="Call Again"
avatar={<img src="/avatar.jpg" alt="" />}
backgroundUrl="/background.jpg"
onButtonClick={() => setShowBusy(false)}
/>
) : (
<PilotKit onBusy={() => setShowBusy(true)} {...props}>
{/* ... */}
</PilotKit>
)}
</>
);
}

Responsive Adaptation

FeaturePCMobile
Content AlignmentVertical centerTop alignment + padding
Avatar Size120px100px
Font Size16px14px

Props

PropertyTypeDefaultDescription
showbooleanfalseWhether to show
variant'auto' | 'mobile' | 'desktop''auto'Display mode
classNamestring-Custom class name
styleCSSProperties-Custom style
backgroundUrlstring-Background image URL
avatarReactNode-Avatar element
messagestring-Status message
buttonTextstring'OK'Button text
onButtonClick() => void-Button click callback

Custom Rendering

<StatusOverlay show={showStatus}>
{({avatar, message, buttonText, onButtonClick}) => (
<div className="my-status">
<div className="avatar">{avatar}</div>
<p className="message">{message}</p>
<button onClick={onButtonClick}>{buttonText}</button>
</div>
)}
</StatusOverlay>

Style Customization

Class NameDescription
.apk-status-overlay-wrapperOuter container
.apk-status-overlayInner container (frosted glass effect)
.apk-status-overlay__contentContent area
.apk-status-overlay__avatar-wrapperAvatar wrapper
.apk-status-overlay__avatar-outerAvatar outer layer
.apk-status-overlay__messageStatus message
.apk-status-overlay__buttonAction button

Common Scenarios

// Busy state
<StatusOverlay
show={isBusy}
message="Sorry, I'm busy right now, please try again later"
buttonText="Call Again"
onButtonClick={handleRetry}
/>

// Timeout state
<StatusOverlay
show={isTimeout}
message="This conversation flow has ended, I've hung up"
buttonText="Start Again"
onButtonClick={handleRestart}
/>

// Error state
<StatusOverlay
show={hasError}
message="Connection failed, please check network and retry"
buttonText="Retry"
onButtonClick={handleRetry}
/>