Vanilla Breeze

Chat

Chat integration patterns: floating launcher, embedded with sidebar, and full-page layouts using existing VB primitives.

Overview

These patterns compose <chat-window> with existing VB primitives to create complete chat experiences. No new custom elements are needed — <dialog>, commandfor, and <layout-sidebar> handle the shell.

Floating Launcher

A fixed-position FAB button opens a <dialog> containing chat-window. The commandfor/command attributes handle open/close automatically with proper focus management.

Unread Badge

Add an unread count using <layout-badge> positioned over the trigger button.

Embedded with Sidebar

For always-visible chat panels, use <layout-sidebar> with a chat history list in the aside. The sidebar collapses on narrow viewports.

Full-Page with History Drawer

A full-viewport chat using height: 100dvh on the window. The history drawer uses <dialog data-position="start"> for a slide-in panel triggered from the header.

Key Primitives Used

Need Primitive Why
Launcher trigger commandfor / command="show-modal" Native focus management, no JS
Chat overlay <dialog> Modal with backdrop, Escape to close
History drawer <dialog data-position="start"> Slide-in panel with VB styling
Split layout <layout-sidebar> Responsive sidebar collapse
Unread count <layout-badge> Color-coded badge overlay

Related