I built a Svelte 5 + SvelteKit 2 scaffold for a ChatGPT-style chat interface: sticky, pill-shaped composer; a scrollable message thread with clear user/assistant alignment; smooth auto-scroll to the latest message; and accessible, keyboard-friendly interaction. The experience mirrors ChatGPT’s proven UX so it feels familiar and intuitive.
Beyond the surface UI, it is intentionally designed as a standalone, reusable foundation that can plug into any conversational AI or agent backend. The layout and component architecture are structured for streaming APIs, richer message rendering, and multi-turn state. It draws heavy inspiration from assistant-ui and is tailored for reuse in my other work, notably DOC_Project_2025.
The UI follows a modular, state-driven design built around Svelte 5 runes:
Message Thread: A scrollable message list with clear user/assistant alignment and smooth auto-scroll behavior.
Composer: A sticky, pill-shaped input component designed for keyboard-first interaction and visual consistency.
State & Effects: Uses Svelte runes ($effect) to update scroll position when messages change.
1. Message State
messages = [...messages, newMessage];
2. Auto-Scroll
$effect(() => {
scrollTop = scrollHeight;
});
3. Input Handling
assistant_ui_svelte/
│
├── src/
│ ├── lib/
│ │ ├── components/
│ │ │ ├── ChatShell.svelte
│ │ │ ├── MessageList.svelte
│ │ │ └── Composer.svelte
│ │ └── styles/
│ ├── routes/
│ │ └── +page.svelte
│ └── app.css
│
├── static/
├── package.json
├── svelte.config.js
├── vite.config.ts
└── README.md
The ChatGPT-style framework is complete and running locally, with:
Responses are currently mocked—the architecture is ready for a streaming LLM backend.
position: sticky shell.$effect) to update scroll position on message change.node_modules, reinstall).A reusable Svelte 5 + SvelteKit 2 ChatGPT-style chat UI (sticky composer, scrollable aligned thread, auto-scroll, a11y) designed to plug into real LLM/agent backends; currently mocked but architected for streaming, richer messages, and multi-turn state—ready to reuse across projects like DOC_Project_2026.
Project Duration: August 2025
Technologies: Svelte 5, SvelteKit 2, Vite 7, TypeScript, Less, Node.js, npm, Git