import type { Meta, StoryObj } from 'storybook-solidjs-vite'; import { createSignal } from 'solid-js'; import { ChatConfig, ChatContainer, ChatContainerContent, ChatContainerScrollAnchor, Message, MessageContent, MessageActions, PromptInput, PromptInputTextarea, PromptInputActions, ModelSwitcher, Button, } from '../index'; import type { ModelOption } from '../types'; import { Copy, ThumbsUp, ArrowUp } from 'lucide-solid'; const meta: Meta = { title: 'Patterns/Centered Conversation', parameters: { layout: 'centered', docs: { description: { component: 'A single, centered reading column with no sidebar (Claude.ai-style). The messages and composer share one `max-w` measure centered in the viewport — ideal for a focused, full-window chat. Contrast with **Chat Panel Layout** (a compact embedded panel) and the **Full Chat App** example (a resizable workspace).', }, }, }, }; export default meta; type Story = StoryObj; const models: ModelOption[] = [ { id: 'claude-4', name: 'Claude 4 Opus', provider: 'Anthropic' }, { id: 'gpt-4o', name: 'GPT-4o', provider: 'OpenAI' }, ]; const answer = `Sure — here's the gist: - **Signals** are fine-grained, so only the DOM that reads a signal updates. - **No re-renders** — components run once; reactive expressions do the work. - **No dependency arrays** — effects auto-track what they read. Want a code example next?`; export const Focused: Story = { render: () => { const [input, setInput] = createSignal(''); const [model, setModel] = createSignal('claude-4'); return (
New conversation
In one paragraph, why is SolidJS reactivity fast?
{answer}
setInput('')}>
); }, };