We are still updating this page. Some data may be missing here — we will complete it shortly.
Usage 2.2+
The ChatPalette component is a structured layout wrapper that organizes ChatMessages in a scrollable content area and ChatPrompt in a fixed bottom section, creating cohesive chatbot interfaces for modals, slideovers.
<template>
<B24ChatPalette>
<B24ChatMessages />
<template #prompt>
<B24ChatPrompt />
</template>
</B24ChatPalette>
</template>
Examples
Within a Modal
You can use the ChatPalette component inside a Modal's content.
Within ContentSearch
You can use the ChatPalette component conditionally inside ContentSearch's content to display a chatbot interface when a user selects an item.
You can enhance your chatbot with tool calling capabilities using the Model Context Protocol (
@ai-sdk/mcp).
This allows the AI to search your documentation or perform other actions:server/api/search.ts
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'
import { streamText, convertToModelMessages, stepCountIs } from 'ai'
import { experimental_createMCPClient } from '@ai-sdk/mcp'
import { createDeepSeek } from '@ai-sdk/deepseek'
export default defineEventHandler(async (event) => {
const { messages } = await readBody(event)
const httpTransport = new StreamableHTTPClientTransport(
new URL('https://your-app.com/mcp')
)
const httpClient = await experimental_createMCPClient({
transport: httpTransport
})
const tools = await httpClient.tools()
const deepseek = createDeepSeek({
apiKey: process.env.DEEPSEEK_API_KEY ?? ''
})
return streamText({
model: deepseek('deepseek-reasoner'), // or 'deepseek-chat'
maxOutputTokens: 10000,
system: 'You are a helpful assistant. Use your tools to search for relevant information before answering questions.',
messages: convertToModelMessages(messages),
stopWhen: stepCountIs(6),
tools,
onFinish: async () => {
await httpClient.close()
},
onError: async (error) => {
console.error(error)
await httpClient.close()
}
}).toUIMessageStreamResponse()
})
API
Props
Slots
Theme
app.config.ts
export default defineAppConfig({
b24ui: {
chatPalette: {
slots: {
root: 'relative flex-1 flex flex-col min-h-0 min-w-0',
prompt: 'px-0 rounded-t-none border-t border-(--ui-color-divider-default)',
close: '',
content: 'overflow-y-auto flex-1 flex flex-col py-3'
}
}
}
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
chatPalette: {
slots: {
root: 'relative flex-1 flex flex-col min-h-0 min-w-0',
prompt: 'px-0 rounded-t-none border-t border-(--ui-color-divider-default)',
close: '',
content: 'overflow-y-auto flex-1 flex flex-col py-3'
}
}
}
})
]
})