import type { ExampleUsage, StoryUsage } from './types';
/**
* Focused — full-window, single-column reading layout (Claude.ai-style).
* A `max-w` measure centered in the viewport; user messages right-aligned,
* assistant messages left-aligned, composer pinned below.
*/
const focused: StoryUsage = {
intro:
'Use **Centered Conversation** for a full-window, distraction-free chat — the Claude.ai layout. A `max-w` reading column is centered in the viewport: user messages align right inside pill bubbles, assistant responses align left with markdown + hover action bar, and the `PromptInput` composer is pinned to the bottom, also constrained to the same max-width. Prefer this over the Chat Panel Layout when the chat *is* the page, not a widget embedded inside one.',
snippets: {
html: `
New conversation
Why is SolidJS reactivity fast?
Signals are fine-grained — only the DOM nodes that read a signal update.
`,
react: `import { useState } from 'react';
import {
ChatConfig, ChatContainer, ChatContainerContent, ChatContainerScrollAnchor,
Message, MessageContent, MessageActions,
PromptInput, PromptInputTextarea, PromptInputActions,
Button,
} from '@kitn.ai/chat/react';
/**
* Centered Conversation — full-window single reading column.
* User messages right-aligned; assistant messages left-aligned with
* markdown + hover actions. Composer constrained to the same max-width.
*/
export function CenteredConversation() {
const [input, setInput] = useState('');
return (
{/* Optional header */}
New conversation
{/* Scrollable thread */}
{/* User message — right-aligned bubble */}
Why is SolidJS reactivity fast?
{/* Assistant message — left-aligned with hover actions */}
Signals are fine-grained — only the DOM nodes that read a signal update.
{/* Composer — same max-width as messages */}
setInput('')}>
);
}`,
vue: `
New conversation
Why is SolidJS reactivity fast?
Signals are fine-grained — only the DOM nodes that read a signal update.
`,
svelte: `
New conversation
Why is SolidJS reactivity fast?
Signals are fine-grained — only the DOM nodes that read a signal update.