Veil UI
Components

Chat Page

A two-pane messaging interface with conversations and composer.

Installation

$ npx veil-ui@latest add chat-page

Usage

import { ChatPage } from "@/components/ui/chat-page";

<ChatPage />;

Examples

Basic

OP

Owen Park

Online

Today
OP
Pushed the fix for the demo source drift. Registry build is green again.

10:42

MC
Nice. Did the token page make it into this batch?

10:44

OP
Yes — plus the new comparison table demo. Can you take a look at the spacing on the pricing section?

10:45

MC
On it. I will review before lunch and drop notes in the PR.

10:47

Owen is typing…

Enter to send · Shift + Enter for a new line

API reference

The package exports chat-page along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.

Accessibility

  • Page templates use semantic landmarks and a single page-level heading.
  • Navigation links and actions have discernible names and visible focus styles.
  • Decorative imagery uses empty alt text; content images carry descriptions.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add chat-page --framework vue or switch the framework in components.json.

<template>
<div data-slot="chat-page" class="grid overflow-hidden rounded-xl border bg-background lg:grid-cols-[280px_1fr] min-h-[600px]"><aside class="hidden flex-col border-r lg:flex"><div class="flex items-center justify-between border-b px-4 py-3"><div data-slot="logo" class="inline-flex items-center gap-1.5"><span data-slot="logo-mark" class="flex shrink-0 items-center justify-center overflow-hidden rounded-md size-6"><span class="grid size-full place-items-center bg-primary text-[10px] font-bold text-primary-foreground">V</span></span><span data-slot="logo-name" class="font-semibold tracking-tight text-sm">Messages</span></div><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-accent hover:text-accent-foreground size-9" aria-label="New conversation"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus" aria-hidden="true"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg></button></div><div class="px-3 py-2"><div class="relative"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" aria-hidden="true"><path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle></svg><input data-slot="input" class="w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 shadow-xs outline-none transition-[color,box-shadow,border-color] placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30 h-8 pl-8 text-sm" placeholder="Search messages" aria-label="Search messages"/></div></div><div dir="ltr" data-slot="scroll-area" class="relative overflow-hidden flex-1" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><div data-radix-scroll-area-viewport="" data-slot="scroll-area-viewport" class="size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/50" style="overflow-x:hidden;overflow-y:hidden"><div style="min-width:100%;display:table"><ul class="space-y-0.5 px-2 pb-2"><li><a href="#thread" aria-current="page" class="flex items-center gap-2.5 rounded-md px-2 py-2 transition-colors hover:bg-accent bg-accent"><div class="relative"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">OW</span></span><span data-slot="status-indicator" data-status="online" class="inline-flex items-center gap-1.5 text-xs text-muted-foreground absolute -bottom-0.5 -right-0.5"><span class="relative flex size-2" aria-hidden="true"><span class="relative inline-flex size-2 rounded-full bg-emerald-500"></span></span></span></div><div class="min-w-0 flex-1"><div class="flex items-baseline justify-between gap-2"><p class="truncate text-sm font-medium">Owen Park</p><span class="text-[10px] text-muted-foreground">2m</span></div><p class="truncate text-xs text-muted-foreground">The registry build is green again.</p></div><span data-slot="badge" data-variant="default" class="inline-flex shrink-0 items-center gap-1 overflow-hidden whitespace-nowrap border py-0.5 font-medium transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [&amp;&gt;svg]:pointer-events-none [&amp;&gt;svg]:size-3 border-transparent bg-primary text-primary-foreground size-5 justify-center rounded-full px-0 text-[10px]">2</span></a></li><li><a href="#thread" class="flex items-center gap-2.5 rounded-md px-2 py-2 transition-colors hover:bg-accent"><div class="relative"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">DE</span></span><span data-slot="status-indicator" data-status="away" class="inline-flex items-center gap-1.5 text-xs text-muted-foreground absolute -bottom-0.5 -right-0.5"><span class="relative flex size-2" aria-hidden="true"><span class="relative inline-flex size-2 rounded-full bg-amber-500"></span></span></span></div><div class="min-w-0 flex-1"><div class="flex items-baseline justify-between gap-2"><p class="truncate text-sm font-medium">Design guild</p><span class="text-[10px] text-muted-foreground">18m</span></div><p class="truncate text-xs text-muted-foreground">Lena: Added the new token page.</p></div></a></li><li><a href="#thread" class="flex items-center gap-2.5 rounded-md px-2 py-2 transition-colors hover:bg-accent"><div class="relative"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">LE</span></span><span data-slot="status-indicator" data-status="online" class="inline-flex items-center gap-1.5 text-xs text-muted-foreground absolute -bottom-0.5 -right-0.5"><span class="relative flex size-2" aria-hidden="true"><span class="relative inline-flex size-2 rounded-full bg-emerald-500"></span></span></span></div><div class="min-w-0 flex-1"><div class="flex items-baseline justify-between gap-2"><p class="truncate text-sm font-medium">Lena Ortiz</p><span class="text-[10px] text-muted-foreground">1h</span></div><p class="truncate text-xs text-muted-foreground">Can you review the empty states?</p></div><span data-slot="badge" data-variant="default" class="inline-flex shrink-0 items-center gap-1 overflow-hidden whitespace-nowrap border py-0.5 font-medium transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [&amp;&gt;svg]:pointer-events-none [&amp;&gt;svg]:size-3 border-transparent bg-primary text-primary-foreground size-5 justify-center rounded-full px-0 text-[10px]">1</span></a></li><li><a href="#thread" class="flex items-center gap-2.5 rounded-md px-2 py-2 transition-colors hover:bg-accent"><div class="relative"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">SA</span></span><span data-slot="status-indicator" data-status="offline" class="inline-flex items-center gap-1.5 text-xs text-muted-foreground absolute -bottom-0.5 -right-0.5"><span class="relative flex size-2" aria-hidden="true"><span class="relative inline-flex size-2 rounded-full bg-muted-foreground"></span></span></span></div><div class="min-w-0 flex-1"><div class="flex items-baseline justify-between gap-2"><p class="truncate text-sm font-medium">Sam Rivera</p><span class="text-[10px] text-muted-foreground">3h</span></div><p class="truncate text-xs text-muted-foreground">Triage notes are in the doc.</p></div></a></li><li><a href="#thread" class="flex items-center gap-2.5 rounded-md px-2 py-2 transition-colors hover:bg-accent"><div class="relative"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">RE</span></span><span data-slot="status-indicator" data-status="online" class="inline-flex items-center gap-1.5 text-xs text-muted-foreground absolute -bottom-0.5 -right-0.5"><span class="relative flex size-2" aria-hidden="true"><span class="relative inline-flex size-2 rounded-full bg-emerald-500"></span></span></span></div><div class="min-w-0 flex-1"><div class="flex items-baseline justify-between gap-2"><p class="truncate text-sm font-medium">Release crew</p><span class="text-[10px] text-muted-foreground">Yesterday</span></div><p class="truncate text-xs text-muted-foreground">Ship checklist for 2.4.0</p></div></a></li></ul></div></div></div><div class="border-t p-3"><div class="flex items-center gap-2"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">MC</span></span><div class="min-w-0 flex-1"><p class="truncate text-sm font-medium">Mira Chen</p><p class="text-xs text-muted-foreground">Available</p></div><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-accent hover:text-accent-foreground size-9" aria-label="Archive"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-archive" aria-hidden="true"><rect width="20" height="5" x="2" y="3" rx="1"></rect><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"></path><path d="M10 12h4"></path></svg></button></div></div></aside><section class="flex min-w-0 flex-col"><header class="flex items-center gap-3 border-b px-4 py-2.5"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">OP</span></span><div class="min-w-0 flex-1"><p class="text-sm font-medium">Owen Park</p><p class="text-xs text-muted-foreground"><span data-slot="status-indicator" data-status="online" class="inline-flex items-center gap-1.5 text-xs text-muted-foreground"><span class="relative flex size-2" aria-hidden="true"><span class="relative inline-flex size-2 rounded-full bg-emerald-500"></span></span>Online</span></p></div><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-accent hover:text-accent-foreground size-9" aria-label="Voice call"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone" aria-hidden="true"><path d="M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"></path></svg></button><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-accent hover:text-accent-foreground size-9" aria-label="Video call"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video" aria-hidden="true"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"></path><rect x="2" y="6" width="14" height="12" rx="2"></rect></svg></button><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-accent hover:text-accent-foreground size-9" aria-label="Conversation info"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg></button></header><div dir="ltr" data-slot="scroll-area" class="relative overflow-hidden flex-1" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><div data-radix-scroll-area-viewport="" data-slot="scroll-area-viewport" class="size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/50" style="overflow-x:hidden;overflow-y:hidden"><div style="min-width:100%;display:table"><div class="space-y-4 p-4"><div class="flex items-center gap-3 text-xs text-muted-foreground"><span class="h-px flex-1 bg-border" aria-hidden="true"></span>Today<span class="h-px flex-1 bg-border" aria-hidden="true"></span></div><div class="flex items-end gap-2"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">OP</span></span><div class="max-w-[75%] space-y-1"><div class="rounded-2xl px-3.5 py-2 text-sm rounded-bl-sm bg-muted">Pushed the fix for the demo source drift. Registry build is green again.</div><p class="text-[10px] text-muted-foreground">10:42</p></div></div><div class="flex items-end gap-2 flex-row-reverse"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">MC</span></span><div class="max-w-[75%] space-y-1 items-end text-right"><div class="rounded-2xl px-3.5 py-2 text-sm rounded-br-sm bg-primary text-primary-foreground">Nice. Did the token page make it into this batch?</div><p class="text-[10px] text-muted-foreground">10:44</p></div></div><div class="flex items-end gap-2"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">OP</span></span><div class="max-w-[75%] space-y-1"><div class="rounded-2xl px-3.5 py-2 text-sm rounded-bl-sm bg-muted">Yes — plus the new comparison table demo. Can you take a look at the spacing on the pricing section?</div><p class="text-[10px] text-muted-foreground">10:45</p></div></div><div class="flex items-end gap-2 flex-row-reverse"><span data-slot="avatar" data-size="sm" class="relative flex shrink-0 overflow-hidden rounded-full bg-muted size-6 text-[10px]"><span data-slot="avatar-fallback" class="flex size-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground">MC</span></span><div class="max-w-[75%] space-y-1 items-end text-right"><div class="rounded-2xl px-3.5 py-2 text-sm rounded-br-sm bg-primary text-primary-foreground">On it. I will review before lunch and drop notes in the PR.</div><p class="text-[10px] text-muted-foreground">10:47</p></div></div><div class="flex items-center gap-1.5 pl-10 text-xs text-muted-foreground"><span class="size-1.5 animate-pulse rounded-full bg-muted-foreground" aria-hidden="true"></span>Owen is typing…</div></div></div></div></div><div class="border-t p-3"><div class="flex items-end gap-2 rounded-lg border p-1.5"><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-accent hover:text-accent-foreground size-9" aria-label="Add image"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image-plus" aria-hidden="true"><path d="M16 5h6"></path><path d="M19 2v6"></path><path d="M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5"></path><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path><circle cx="9" cy="9" r="2"></circle></svg></button><input data-slot="input" class="w-full min-w-0 rounded-md border-input bg-transparent px-3 py-1 text-sm outline-none transition-[color,box-shadow,border-color] placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30 h-8 border-0 shadow-none focus-visible:ring-0" placeholder="Write a message…" aria-label="Message"/><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-accent hover:text-accent-foreground size-9" aria-label="Add emoji"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-face-slightly-smiling lucide-smile" aria-hidden="true"><path d="M15 10V9"></path><path d="M16.472 15a6 6 0 01-8.943 0"></path><path d="M9 10V9"></path><circle cx="12" cy="12" r="10"></circle></svg></button><button data-slot="button" data-variant="default" data-size="icon" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 bg-primary text-primary-foreground hover:bg-primary/90 size-9" aria-label="Send message"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send" aria-hidden="true"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"></path><path d="m21.854 2.147-10.94 10.939"></path></svg></button></div><p class="mt-1.5 text-[10px] text-muted-foreground">Enter to send · Shift + Enter for a new line</p></div></section></div>
</template>

On this page