This is the full developer documentation for aparté # Articles > Dated pieces on what changes around agents and their chat interfaces, each with its sources and the code that checks it. Dated pieces on what changes around agents and the chats in front of them, and what it means for a page that hosts one. Each article names its sources, and the code it shows is tested, in this repository or in the package’s own. * **[aparté 1.0: what the number promises, and where the library goes next](/articles/aparte-1-0/)**, November 8, 2026. What the version commits to, what the beta taught, and what comes next, from sub-agents and a canvas to a chat that does not need our design system. * **[n8n’s chat widget: what people run into, and a replacement that takes the same call](/articles/n8n-chat-widget/)**, October 27, 2026. The problems n8n users report most with `@n8n/chat`, with their sources, what n8n 3.0 changes for a chat widget, and `@aparte/n8n-chat`, a `createChat` that takes the same options, tested against a live n8n. * **[Agent Builder shuts down on November 30: stop tying your chat UI to a vendor](/articles/agent-builder-shutdown/)**, October 26, 2026. What stops when OpenAI closes Agent Builder, the migration path, and how an open protocol between the agent and the chat makes the next shutdown cheaper. With a demo that runs without a key. # Agent Builder shuts down on November 30: stop tying your chat UI to a vendor > OpenAI's Agent Builder closes on November 30, 2026. What stops, what the migration path is, and how to put an open protocol between your agent and its chat so the next shutdown costs less — with a tested demo. *Published October 26, 2026.* On November 30, 2026, OpenAI shuts down Agent Builder, the visual editor that ran agent workflows on OpenAI’s servers. It was released in late 2025 and deprecated on June 3, 2026. If your chat talks to an Agent Builder workflow, it stops working that day. This page covers what stops, the way out OpenAI documents, and one choice that would have made this shutdown cheaper: an open protocol between the chat and the agent. ## What stops, and what stays [Section titled “What stops, and what stays”](#what-stops-and-what-stays) | Date | What happens | | ----------------- | ------------------------------------------------------------------- | | June 3, 2026 | OpenAI notifies Agent Builder users that the product is deprecated. | | November 30, 2026 | Agent Builder is scheduled to shut down. | Source: OpenAI’s [deprecations page](https://developers.openai.com/api/docs/deprecations). **ChatKit stays.** ChatKit is OpenAI’s chat component, and its recommended setup pointed it at an Agent Builder workflow. What goes is that backend: a ChatKit embed connected to an Agent Builder workflow works only “during the Agent Builder transition window”, in the words of the [ChatKit guide](https://developers.openai.com/api/docs/guides/chatkit). After that, ChatKit needs a server you run, through its “custom server integration” and the ChatKit Python SDK. **The migration path is an export to code.** In Agent Builder, **Code → Agents SDK** exports the workflow as TypeScript or Python for the [OpenAI Agents SDK](https://openai.github.io/openai-agents-js/). You run that code yourself, or paste it into a ChatGPT Workspace Agent, which needs a Business, Enterprise or Edu plan. OpenAI’s [migration guide](https://developers.openai.com/api/docs/guides/agent-builder/migrate-from-agent-builder) is candid about the limits: the export “does not convert your workflow graph or guarantee that every behavior transfers unchanged”. ## What it cost the people who built on it [Section titled “What it cost the people who built on it”](#what-it-cost-the-people-who-built-on-it) The [deprecation thread](https://community.openai.com/t/1382650) on OpenAI’s forum, from June 2026, shows what the export leaves you to do: * One developer who built ChatKit apps for several clients on Agent Builder wrote that managing the backend themselves “makes the use of this tool economically unviable”. * Several rebuilt the backend on servers of their own, such as a FastAPI server deployed on IBM or a container on AWS Lambda. The thread then turns to cold starts: one developer had cut theirs “from 30 seconds to just under 20. Still way too long.”, and moved to Lambda, where another had measured about three seconds. * “Agent Builder was much easier. I am already missing it.” None of this is about the chat. The chat was fine. It stopped working because it was wired to a product’s backend: a workflow ID, exchanged by your server for a client secret, opening a session on OpenAI’s hosted workflow. The interface and the backend were one product, so when the backend went, the integration went with it. ## Put a protocol between the chat and the agent [Section titled “Put a protocol between the chat and the agent”](#put-a-protocol-between-the-chat-and-the-agent) The lesson is not “avoid OpenAI”. The Agents SDK code you export is a good place to be. The lesson is about the line between the chat and the agent: make it a **protocol that both sides can implement independently**, not a product’s session API. Then you can change either side without touching the other: move the agent to another host, another framework or another model, or move the chat to another library. [AG-UI](https://docs.ag-ui.com) is such a protocol. It is an open, MIT-licensed event stream for agent UIs: text as it is written, tool calls with their arguments and results, state, and interrupts for human approval. Agno, LangGraph, Mastra, CrewAI, Pydantic AI and Google’s ADK serve their agents over it, and TanStack AI is [compliant in both directions](https://tanstack.com/blog/ag-ui-compliance). AG-UI lists the OpenAI Agents SDK integration as “in progress” ([AG-UI README](https://github.com/ag-ui-protocol/ag-ui)), so today it takes about eighty lines of glue. Here they are. ### 1. The agent, as Agent Builder exports it [Section titled “1. The agent, as Agent Builder exports it”](#1-the-agent-as-agent-builder-exports-it) ```ts import { Agent, tool } from '@openai/agents'; export const getOrderStatus = tool({ name: 'get_order_status', description: 'Look up where an order is, by its number.', parameters: { type: 'object', properties: { orderNumber: { type: 'string' } }, required: ['orderNumber'], additionalProperties: false, }, strict: true, async execute(input) { const { orderNumber } = input as { orderNumber: string }; return { orderNumber, status: 'shipped', carrier: 'La Poste', arrives: 'in 2 days' }; }, }); export const supportAgent = new Agent({ name: 'Support', instructions: 'You answer questions about orders. Look an order up before saying where it is.', tools: [getOrderStatus], }); ``` This file never mentions the chat. That is the point. ### 2. The bridge: the agent’s run, as AG-UI events [Section titled “2. The bridge: the agent’s run, as AG-UI events”](#2-the-bridge-the-agents-run-as-ag-ui-events) The Agents SDK streams its run as events: the model’s text deltas, then each tool call and its output. The bridge reads them and writes AG-UI events as server-sent events. It is a Web `Request` in and a Web `Response` out, so it drops into a Next.js route, Hono, Deno, Bun or a Worker as it is. This is the core of it: ```ts send({ type: EventType.RUN_STARTED, threadId, runId }); const result = await runner.run(agent, toAgentInput(messages), { stream: true, signal: request.signal }); for await (const event of result) { if (event.type === 'raw_model_stream_event' && event.data.type === 'output_text_delta') { // first word: TEXT_MESSAGE_START, then one TEXT_MESSAGE_CONTENT per delta send({ type: EventType.TEXT_MESSAGE_CONTENT, messageId: open, delta: event.data.delta }); } else if (event.type === 'run_item_stream_event') { const raw = event.item.rawItem; if (event.name === 'tool_called' && raw.type === 'function_call') { send({ type: EventType.TOOL_CALL_START, toolCallId: raw.callId, toolCallName: raw.name }); send({ type: EventType.TOOL_CALL_ARGS, toolCallId: raw.callId, delta: raw.arguments }); send({ type: EventType.TOOL_CALL_END, toolCallId: raw.callId }); } else if (event.name === 'tool_output' && raw.type === 'function_call_result') { send({ type: EventType.TOOL_CALL_RESULT, messageId: crypto.randomUUID(), toolCallId: raw.callId, content: resultText(event.item.output) }); } } } await result.completed; send({ type: EventType.RUN_FINISHED, threadId, runId }); ``` The [whole file](https://github.com/apartejs/aparte/blob/main/apps/examples/agents-sdk/server/ag-ui.ts) also validates the request against AG-UI’s own schema and answers 422 otherwise, opens and closes each text message, and reports `RUN_ERROR` when the model fails. When the person presses Stop, the request’s abort signal reaches the SDK, the run ends early, and the bridge reports it as `RUN_FINISHED` with a `cancelled` outcome. ### 3. The page [Section titled “3. The page”](#3-the-page) ```ts import { AparteClient } from '@aparte/core'; import { createAgUiRunner } from '@aparte/runner-ag-ui'; new AparteClient({ streamRunner: createAgUiRunner({ endpoint: '/agent' }) }).start(); ``` With an `` in the page, that is the whole front end: the text streams in, each tool call is a row with its arguments and its result, and Stop works. The page knows nothing about the Agents SDK, OpenAI or the model. Any AG-UI client would do here; aparté is the one this site is about. ### The model is now one line [Section titled “The model is now one line”](#the-model-is-now-one-line) Once the agent is your code, the model is a setting. The demo picks it from the environment: | Set | The agent runs on | | ---------------------------- | --------------------------------------------------------------------------------- | | nothing | the Agents SDK’s own `ScriptedModel`: no key, scripted words, real loop and tools | | `OPENAI_API_KEY` | OpenAI | | `MODEL_BASE_URL` and `MODEL` | any Chat Completions server: Mistral, Groq, OpenRouter, a local Ollama | The last row uses the SDK’s `OpenAIProvider` with `useResponses: false`. This is the other half of the lesson: when the vendor you depend on changes course, you want to move without rewriting. The protocol keeps the chat independent of the agent; the SDK’s provider setting keeps the agent independent of OpenAI. ## What you give up compared with ChatKit [Section titled “What you give up compared with ChatKit”](#what-you-give-up-compared-with-chatkit) * **Widgets.** ChatKit draws rich interactive cards that the agent describes in JSON. aparté draws a tool’s result through tool renderers that you register; these are not ChatKit widgets, and nothing translates one into the other. * **Threads in the protocol.** ChatKit’s protocol has threads, and its server SDK defines a store for them that you implement. AG-UI has a thread ID and no storage: your app keeps the conversations. * **Approvals, in this bridge.** AG-UI carries interrupts for human approval and aparté renders them, but the bridge above does not yet map the SDK’s tools that ask for approval. * **Earlier tool calls, in the history.** The bridge rebuilds each turn’s history from the messages’ text, so a tool call from an earlier turn reaches the model as the reply that followed it. A person’s images are dropped. What you gain: the agent stays the code you exported, the chat works with any agent that serves AG-UI, and neither depends on a vendor’s hosted backend. ## How this was checked [Section titled “How this was checked”](#how-this-was-checked) The demo is in the repository: [`apps/examples/agents-sdk`](https://github.com/apartejs/aparte/tree/main/apps/examples/agents-sdk). `pnpm --filter @aparte-workspace/example-agents-sdk dev` runs the page and the agent in one process, with no key. * **14 server tests, no key and no network.** They use the real `Runner` and tool, with the model’s words from the SDK’s `ScriptedModel`. Every event is checked against AG-UI’s own schemas. The stream is read by aparté’s AG-UI runner, the strict reader the page uses. The same agent also runs over HTTP against a local server that speaks Chat Completions, through the SDK’s own client: the tool call arrives in pieces, its result goes back, and the answer streams. * **3 browser tests** drive the page: the tool row and the answer, the history sent on the next turn, and Stop in the middle of a reply. * **Not checked:** OpenAI’s own API, Mistral and Ollama themselves. There are no keys in the test run, so the Chat Completions path is tested against a local server that speaks that format. Versions: `@openai/agents` 0.21.0, `@ag-ui/core` 1.0.3, aparté 0.27. ## Sources [Section titled “Sources”](#sources) * OpenAI, [Deprecations](https://developers.openai.com/api/docs/deprecations), entry of June 3, 2026. * OpenAI, [ChatKit](https://developers.openai.com/api/docs/guides/chatkit) and [Migrate from Agent Builder](https://developers.openai.com/api/docs/guides/agent-builder/migrate-from-agent-builder). * OpenAI Developer Community, [Deprecation notice: Agent Builder](https://community.openai.com/t/1382650), June 2026. * [AG-UI](https://docs.ag-ui.com) and its [README](https://github.com/ag-ui-protocol/ag-ui). * aparté, [AG-UI runner](/providers/agent/ag-ui/). # aparté 1.0: what the number promises, and where the library goes next > aparté 1.0 is out. What the version commits to, what the beta taught, and what comes next, from sub-agents and a canvas to a chat that does not need our design system. *Published November 8, 2026.* aparté 1.0.0 went out on November 7, 2026. aparté is a chat for AI that comes as web components: you place it in a page, with React, Vue, Svelte, Angular or no framework, and it talks to your model or your agent through whatever you already run. The number does not mean more features than the day before. It means a promise. This page says what that promise covers, how the library got there, and what comes next. ## What 1.0 promises [Section titled “What 1.0 promises”](#what-10-promises) From 1.0.0, aparté follows semantic versioning on a declared surface. A frozen name keeps its name, and what its documentation says it does, until 2.0. | Frozen | Not frozen | | --------------------------------------------- | ------------------------------------------------- | | element tags and the attributes they document | the methods of an element or of an exported class | | event names | the fields of an interface | | what each package’s main entry exports | type names, and other subpath entries | | locale keys | the keys a plugin adds to the locale | | `--aparte-*` token names | a token’s default value, and class names | A frozen name leaves in two steps: a notice in a minor release, where the old name still works and your editor strikes it through, then the removal in the next major. There is one exception, for security: a fix that closes a hole may refuse what used to be accepted, in any release, and its changelog entry says so on its first line. The [stability page](/reference/stability/) lists that surface, generated from the code itself. Every `@aparte` package ships at the same version, so there is one number to follow. ## What the beta taught [Section titled “What the beta taught”](#what-the-beta-taught) The beta ran from 0.17.0, on September 12, to 0.32.1, on November 2. It froze names, and it held them, with one exception: 0.27.0 removed a locale package without a notice release. What it did not freeze was what those names did. Behaviour and defaults still moved under them, for example the copy button, which went off by default in 0.27.1. Each change was in the notes of its release, but you had to read them. That is why the 1.0 promise covers what a name does as well as the name, and why the stability page lists every such change the beta made. The rest of the road to 1.0 was a list of conditions that could be measured. The [roadmap](/roadmap/) keeps it item by item. Among them: * **A [performance budget](/reference/performance/)**: token to paint, the memory of a 500-message conversation, gzip per package. Every pull request is checked against it. * **Server rendering, proven**: a production build on Next, Nuxt, SvelteKit and Angular SSR, rendered on the server and hydrated in a browser, in CI. * **[Accessibility](/guides/accessibility/)**: a statement of what is covered and tested, and right-to-left checked in real browsers. * **Every locale carries every key**, and every package is published from CI with npm provenance. 1.0.0 also removed what the beta had marked as deprecated, so the stable line does not start by carrying it. ## What it is today [Section titled “What it is today”](#what-it-is-today) [Why aparté](/why/) has the choices in full. In short: `@aparte/core` has one dependency, `@aparte/engine`, released with it. The model can be called from the browser or from your server. The agent loop can be ours, yours, or one running elsewhere, over AG-UI or n8n. A tool call can wait for a person’s approval, and with the loop on your server that approval survives a reload. Maths, diagrams, charts and cards are plugins you add when you need them. Routing, sign-in, settings screens and a backend stay your product’s. ## Where it goes next: a full assistant [Section titled “Where it goes next: a full assistant”](#where-it-goes-next-a-full-assistant) 1.0 is a solid chat. It is not yet everything it takes to build an assistant like ChatGPT or Claude, and that is the direction for 1.x. It stays a library: aparté provides the parts, and the product stays yours. * **Sub-agents and workflows.** aparté shows an agent’s text, reasoning and tool calls. It does not yet show its steps and sub-agents as such: the [AG-UI runner](/providers/agent/ag-ui/) does not tell a sub-agent’s output from the main agent’s. They should be drawn as what they are. * **A canvas.** A document open beside the conversation, that the model writes and the reader keeps working on. * **[Artifacts](/components/artifact/), reworked.** Today an artifact is a card inside the reply, with its code and a sandboxed preview, and showing it anywhere else is left to your app. * **More plugins, and more customization**, starting with ready-made skins: token sheets, pure CSS. The proof will be an example app that puts it all together. That follows the rule this library already keeps: a capability ships when something in this repository exercises it end to end. All of this adds to 1.x. None of it changes a frozen name. ## Further out: not hostage to our design system [Section titled “Further out: not hostage to our design system”](#further-out-not-hostage-to-our-design-system) Today the core package carries both the chat’s logic and its interface, our design system included. You can restyle our buttons through tokens and replace some pieces by hand, but there is no single place to say “use my buttons everywhere”. A team with a design system of its own should not have to choose between that system and this chat. The idea for a future 2.0 is to separate the two. The interface would live in a package of its own, and the code would ask for “a button” without knowing who draws it. By default, that is aparté’s. A small plugin could map it to shadcn’s, PrimeNG’s, or yours. The pattern is known. [BlockNote](https://github.com/TypeCellOS/BlockNote) does it for an editor, with one package per UI library, and [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form) and [ngx-formly](https://github.com/ngx-formly/ngx-formly) do it for forms. We have not seen it done for a chat. This is an idea, not a plan with a date. It belongs to 2.0 because it moves things, and until then, the promise above holds. ## Try it [Section titled “Try it”](#try-it) [Getting started](/guides/getting-started/) is the place to begin, and the [changelog](/changelog/) has every release. If something is missing for what you are building, [open an issue](https://github.com/apartejs/aparte/issues). ## Sources [Section titled “Sources”](#sources) * [`@aparte/core` on npm](https://www.npmjs.com/package/@aparte/core?activeTab=versions), for the release dates. * aparté, [What will not change under you](/reference/stability/), [Roadmap](/roadmap/) and [Changelog](/changelog/). # n8n's chat widget: what people run into, and a replacement that takes the same call > The problems n8n users report most with @n8n/chat — styling, a bubble full of JSON, tool steps after a reload, sessions, accessibility — what n8n 3.0 changes, and a createChat that takes the same options, tested against a live n8n. *Published October 27, 2026.* n8n’s chat widget, [`@n8n/chat`](https://www.npmjs.com/package/@n8n/chat), is how most n8n chat workflows reach a website: a ``, a `createChat({ webhookUrl })`, and a bubble in the corner talks to the workflow’s Chat Trigger. It is used a lot: 62,029 npm downloads in the month to October 22, 2026, and 73 million jsDelivr hits a month — n8n’s own hosted chat page loads it from jsDelivr, which likely accounts for much of that. And its community forum keeps returning to the same few problems. This page lists them with their sources, says what n8n 3.0 changes, and shows a replacement we built and tested against a live n8n, [`@aparte/n8n-chat`](/other-plugins/n8n-chat/): it takes the same call. ## What people run into [Section titled “What people run into”](#what-people-run-into) **Styling stops at CSS variables.** The most viewed thread about the widget asks how to customise its window ([8,843 views](https://community.n8n.io/t/how-to-customise-the-chat-window-on-my-website/88704)). In another, the answer is plain: “We only have the option to change the root variables”; past them, the advice is to fork the project ([CSS Customization of /chat integration](https://community.n8n.io/t/css-customization-of-chat-integration/54351)). The widget ships 115 `--chat--*` variables; beyond them, its classes are not a documented API, and some of its rules carry Vue’s per-build attribute hashes. **A bubble full of JSON.** When the last node’s answer has no `output`, `text` or `message` field, the widget prints the whole response into the bubble ([Chat embed returns JSON](https://community.n8n.io/t/chat-embed-returns-json/52574)). The workflow is right there to fix, but nothing tells the developer which field is missing. **Tool steps after a reload.** With *Load Previous Session*, the history comes back from the agent’s memory, which — with recent AI Agent versions — stores a tool’s call and its result beside the messages, and the widget draws them as bot bubbles, the result as raw JSON ([after page reload, tool calls show up as AI messages](https://community.n8n.io/t/embedded-chat-after-page-reload-tool-calls-intermediate-steps-show-up-as-ai-messages-need-to-keep-steps-for-an/250572)). **No way to start over.** With the history on, which is the default, the widget reuses the session stored in the browser: the source of `startNewSession` keeps it on purpose, and “how do I reset the conversation” is one of the forum’s most read questions ([2,104 views](https://community.n8n.io/t/how-to-reset-clear-ai-agent-chat-conversation-if-using-chat-widget-or-telegram/61494)). `createChat` returns the Vue app, so a page has no documented way to open, close, send or reset the chat other than clicking its elements. **Every page view asks n8n.** With the history on, the widget requests it when the page loads, whether or not the visitor ever opens the chat — on n8n Cloud, an execution per page view ([Embedded chat costs a lot even when not used](https://community.n8n.io/t/embeded-chat-costs-a-lot-even-when-not-used/59476)). **Keyboard and screen readers.** The widget’s components carry no `role`, `aria-*` or `tabindex`: the button in the corner is a `div` with a click handler, and its send button has no name. Its visitor’s bubble, white on `#20b69e`, reads at 2.55:1, where text needs 4.5:1. **And the rest:** English only, with eight strings you can override; no dark scheme; global rules such as `.hljs` and `.empty`, and an `h1` title in your page; about 465 KB of JavaScript in four files, with brotli, for the first render; and the [Sustainable Use License](https://cdn.jsdelivr.net/npm/@n8n/chat@1.43.3/LICENSE.md), which allows distribution only free of charge for non-commercial purposes. ## What n8n 3.0 changes for a chat widget [Section titled “What n8n 3.0 changes for a chat widget”](#what-n8n-30-changes-for-a-chat-widget) n8n’s [3.0 breaking changes](https://docs.n8n.io/changelog/v30-breaking-changes) concern an embedded chat widget in one place: a Chat Trigger that answers through response nodes (the Chat node, for human-in-the-loop flows) talks over a WebSocket, and its frames become JSON. `@n8n/chat` understands both formats from version 1.31.0, so a page pinned to an older version, or a custom client, has to move. The HTTP path — a message posted to the trigger, the answer streamed back as newline-delimited JSON, the history loaded with `loadPreviousSession` — is not on the list. The replacement below reads both WebSocket formats too. ## A replacement that takes the same call [Section titled “A replacement that takes the same call”](#a-replacement-that-takes-the-same-call) [`@aparte/n8n-chat`](/other-plugins/n8n-chat/) is n8n’s widget drawn by aparté. It is [open source](https://github.com/apartejs/n8n-chat), on npm, and served by jsDelivr; the page changes two URLs: ```html ``` That snippet is the version this article was written against. Later versions add cards and quick replies; the widget’s [page](/other-plugins/n8n-chat/) has the current snippet, and the widget has [its own site](https://n8n-chat.apartejs.dev). It keeps what a page relies on: every option and its default, the session in the same `localStorage` key (a visitor keeps their conversation across the switch: we saw both widgets load the same one on the same page), the history, files sent as `files`, `disabled`, the Repost and Reuse actions, `messageComponents` (as functions rather than Vue components), the arrow keys that bring a sent message back, highlighted code, and n8n’s main `--chat--*` variables, which its n8n look reads. And it answers the list above: * `createChat` returns a handle: `open()`, `close()`, `toggle()`, `send()`, `reset()` — which starts a new session — `setDisabled()` and `destroy()`. * In a window, the history is asked for when the chat first opens: a page view alone reaches no n8n execution. * A last node with no `output` gets an error that names the fields it returned, not a bubble of JSON; a visitor reads a short sentence in their language — with the workflow’s own words under it when the workflow reported the error — and the console tells the developer what to change in n8n. * The history leaves out a tool’s call and its result, as the live answer does. * The button in the corner is a button with a name, the window is a labelled region, a phone’s full-screen chat is a modal dialog, the visitor’s bubble reads at 4.7:1, and there is no heading in your page. * Ten languages ship — the page downloads the one it uses — and a dark scheme. About 100 KB of JavaScript and 22 KB of CSS with brotli for the first load, the highlighter joining with the first code block. MIT. It also takes the response-node path: a Chat node’s messages arrive one by one, a Chat node that waits for a written reply gets the visitor’s next message, and one that waits for an approval shows its buttons — with *Block User Input* deciding whether the visitor may write instead, as in n8n’s widget. On n8n 2.x, Chat nodes run only when the Chat Trigger is in *Hosted Chat* mode. What does not carry over is CSS written against n8n’s `.chat-*` classes; the variables do. ## How this was checked [Section titled “How this was checked”](#how-this-was-checked) * **Against a live n8n.** n8n 2.44.6 ran a public Chat Trigger with an AI Agent, a Simple Memory and a Calculator, on a real model (Gemma 3n E2B, served by LM Studio’s OpenAI-compatible endpoint). Its answers were recorded byte for byte — a streamed turn, a tool turn, a turn that read the memory, a text file uploaded in a form, a model refusing an image, a whole answer, the history — and are replayed in the runner’s tests. The response-node path was recorded the same way on n8n 2.44.7: the WebSocket’s frames, a button’s link, a written reply. * **What the recordings taught.** A stream can open on a `keepalive` frame when a slow node runs first; a reader that decides from the first line would take the whole stream for one answer. Every answer is labelled `application/json`, streamed or not. Loading the history from memory fails with an error 500 unless the memory is connected to the Chat Trigger as well as to the agent. And on the socket, every message is followed by `n8n|continue` except the one after which the execution waits for the visitor — which is how a client knows the turn is over. * **Side by side.** Both widgets ran on the same page against the same workflows, in Chromium, option by option. * **Audited.** Independent reviews — the code, these claims, and the widget in a browser with axe — before this article’s first draft; what they found is fixed. The response-node path came after, and was checked against the live n8n, not audited. * **Tests.** The runner has 95, the widget 54, in a DOM over a scripted n8n: the options, the session, the history, the handle, the hooks, the languages, the buttons. * **Not checked:** n8n Cloud, and n8n 3.0, which is not released yet. The nine languages beyond English have not been read by native speakers. Versions: `@n8n/chat` 1.43.3, n8n 2.44.6 and 2.44.7, `@aparte/n8n-chat` 0.1.0 on aparté 0.27.4. ## Sources [Section titled “Sources”](#sources) * npm, [`@n8n/chat`](https://www.npmjs.com/package/@n8n/chat): version 1.43.3, its [license](https://cdn.jsdelivr.net/npm/@n8n/chat@1.43.3/LICENSE.md), and [downloads](https://api.npmjs.org/downloads/point/last-month/@n8n/chat); jsDelivr, [monthly hits](https://data.jsdelivr.com/v1/stats/packages/npm/@n8n/chat?period=month). * n8n community: [How to customise the chat window](https://community.n8n.io/t/how-to-customise-the-chat-window-on-my-website/88704), [CSS Customization of /chat integration](https://community.n8n.io/t/css-customization-of-chat-integration/54351), [Chat embed returns JSON](https://community.n8n.io/t/chat-embed-returns-json/52574), [tool calls after a reload](https://community.n8n.io/t/embedded-chat-after-page-reload-tool-calls-intermediate-steps-show-up-as-ai-messages-need-to-keep-steps-for-an/250572), [resetting the conversation](https://community.n8n.io/t/how-to-reset-clear-ai-agent-chat-conversation-if-using-chat-widget-or-telegram/61494), [embedded chat costs even when not used](https://community.n8n.io/t/embeded-chat-costs-a-lot-even-when-not-used/59476). * n8n on GitHub: [the widget’s source](https://github.com/n8n-io/n8n/tree/master/packages/frontend/%40n8n/chat). * n8n docs, [v3.0 breaking changes](https://docs.n8n.io/changelog/v30-breaking-changes). * aparté: [`@aparte/n8n-chat`](/other-plugins/n8n-chat/), its [repository](https://github.com/apartejs/n8n-chat), and [the n8n runner](/providers/agent/n8n/). # Best AI Chat UI Libraries in 2026, Compared > A dated comparison of AI chat UI libraries (assistant-ui, Deep Chat, Loquix, kitn, ChatKit, AI Elements): Web Components or React, your backend, generative UI. If you are choosing a chat UI library for an LLM product, the libraries below are the ones you will shortlist. This page says what each is good at and where aparté differs — including the cases where you should pick the other one. Claims about other projects were checked against their public docs and npm packages in **October 2026**; the weights below, and the AI Elements, assistant-ui, ChatKit and TanStack AI rows, were re-checked in **November 2026**. They move fast, so verify before deciding. One change to know before you read on: Vercel’s AI Elements announces on its own site that it will be deprecated at the end of November 2026 ([details below](#vercel-ai-elements)). The short version: **aparté is the one that is a complete runtime *and* framework-agnostic *and* free of third-party dependencies.** The React kits have the larger ecosystems. Two of the other web-component kits here, Loquix and kitn, are presentational — you bring the loop. If you need neither framework freedom nor a runtime, you have better options than aparté, and they are named below. ## What a working chat weighs [Section titled “What a working chat weighs”](#what-a-working-chat-weighs) Every library below set up the same way: the chat its docs’ quickstart builds, streaming a model’s reply, bundled and gzipped. The bar is what a page downloads before the chat can answer; the line under it says what that UI holds, and the method under the chart is measured by a script anyone can run again. | Library | At startup | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Loquix 0.6.0 | 27 KB 26 KB + 1 KB CSS Presentational components: the six its Quick Start imports and the token sheet, plus about 50 lines of ours to stream a reply, since it ships no model client; replies are plain text. The full import its README shows: 82 KB + 1 KB CSS. | | Deep Chat 2.5.1 | 120 KB One element with its own clients for 24 AI services (OpenAI, Claude, Gemini, Ollama…), Markdown and tool calls; its styles are inside its JavaScript. The CDN script its docs also list, served as it ships: 105 KB. | | aparté 0.32.1 | 142 KB 119 KB + 22 KB CSS The chat with Markdown while it streams, its own client for any OpenAI-compatible API, and the agent loop with tools and approvals. | | assistant-ui 0.15.32 | 468 KB 401 KB + 67 KB React The AI SDK runtime and the Thread its docs copy into your app: Markdown, tool calls, attachments; the model is called from your server, and its CSS is your Tailwind build’s output. Its LocalRuntime with an adapter you write, in place of the AI SDK: 319 KB + 67 KB React. | | CopilotKit 1.83.0 | 826 KB 740 KB + 19 KB CSS + 67 KB React Its documented React chat: Markdown, math, code highlighting, tool calls and generative UI; its runtime runs on a server and is not counted. | the library’s JavaScript its CSS React, which it needs Measured on 2 November 2026 with esbuild 0.27.7: minified, code splitting on, what loads at startup, gzip level 9; every library at its latest version published before 3 November 2026. Loquix and Deep Chat keep their component styles inside their JavaScript; assistant-ui's CSS comes out of your own Tailwind build and is not counted. CopilotKit's build also splits off 2.9 MB of optional chunks (a grammar per highlighted language, diagrams, a developer inspector), fetched only when a reply needs one. A server is never counted. [The script that measures it ↗](https://github.com/apartejs/aparte/blob/main/scripts/measure-bundles.mjs) At 142 KB, aparté is heavier than Deep Chat (120 KB) and than Loquix (27 KB, which ships no model client), and lighter than the two React kits, whose bars carry React. Against Loquix, the difference is the model client, the loop and the approval gate; Deep Chat, which also carries its own clients, is the lighter of the two complete options. ## The matrix [Section titled “The matrix”](#the-matrix) AI Elements is in the matrix as it stands today; its own site announces its deprecation at the end of November 2026 ([below](#vercel-ai-elements)). Where a cell says *not measured*, that row was not verified for that library, and we do not guess. | Criterion | aparté | assistant-ui | AI Elements | deep-chat | Loquix | kitn | | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ | | Frameworks | Web Components + React, Vue, Svelte, Angular wrappers — tested with React 19, Vue 3.5, Svelte 4 and 5, Angular 19 and 21 | React (Vue bindings in early preview) | React | Web Component (+ React wrapper) | Web Components (Lit) | Web Components (+ React wrappers), built in SolidJS | | Server-rendered page, hydrated with no error | **Tested in CI** with [Next 15 App Router, Nuxt 3, SvelteKit 2, Angular 21 SSR](/frameworks/elements/#on-the-server) | not measured | not measured | not measured | not measured | not measured | | Your framework’s components inside tool calls | **React, Vue, Svelte 5, Angular** — [rendered with your app’s context](/guides/tool-ui/) | Yes, React (tool UI) | Yes, React | not measured | not measured | not measured | | Tool results as interactive cards (generative UI) | **Yes** — [eleven ready-made cards](/guides/cards/) (weather, products, places, orders…) and `defineCard` for your own, with buttons and controls that change a card in place | Yes, React: a generative UI guide in its docs | A Tool component shows a call’s state, input and output; richer widgets are your own React | not measured | not measured | Typed cards: confirmations, choices, forms | | Runtime included (streaming, agent loop, tool calls) | **Yes** — [core](/why/) + [headless engine](/guides/engine/) | Runtime adapters (AI SDK, LangGraph, …) | Via the Vercel AI SDK | Built in, config-driven | No — presentational | No — reads a stream you open (OpenAI, Anthropic) | | Connects to your own backend (OpenAI-compatible, AG-UI, your endpoint) | **Yes** — [any OpenAI-compatible endpoint](/providers/ai/openai-compat/), [your own `/api/chat`](/guides/backend-transport/), an [AG-UI agent](/providers/agent/ag-ui/), an [n8n workflow](/providers/agent/n8n/) | Yes — runtimes for the AI SDK, AG-UI and others, or a local runtime with an adapter you write | Through the AI SDK: your route returns a UI message stream | Yes — a `connect` property for your own service, besides direct connections to AI APIs | You write the `fetch`: no model client | You open the stream (OpenAI or Anthropic format); it renders | | Weight of a working chat (JavaScript and CSS, gzipped) | **142 KB** | 468 KB, React included | not measured: its components are copied into your app | 120 KB | 27 KB, no model client | not measured | | Framework you must adopt | **None** — and no third-party dependency in `@aparte/core` | React | React + the AI SDK | None | None (Lit is bundled) | None | | Human-in-the-loop: tool approval, typed questions | **Approval at the composer, [typed elicitation panel](/guides/elicitation/)** | Generic tool UI | Confirmation component | — | Rendered, not run | Rendered, not run | | Edit / retry / branch a conversation | **[Yes, with a version picker](/guides/conversations-branching/)** | Yes | Partial | — | Partial | — | | Persistence | [An IndexedDB adapter in the browser (`@aparte/plugin-storage-idb`), or a storage interface for your own database](/guides/conversation-persistence/) | Assistant Cloud (a free tier, then paid), or threads you persist yourself | Your own | — | — | — | | Theming | [CSS variables, light DOM](/guides/theming/), no fork | Tailwind / shadcn — fork the markup | shadcn — the code lives in your app | Config object | CSS variables | CSS variables (Shadow DOM) | | Run a model in the browser | Yes — the [transformers provider](/providers/ai/transformers/) | — | — | Yes (Web LLM) | — | — | | Scripted demo/test provider | **Yes — [the scenario provider](/providers/ai/scenario/)** (deterministic turns: thinking, tools, artifacts) | — | — | Demo mode (canned) | — | — | | Markdown, code, reasoning | Yes ([opt-in plugins](/guides/how-it-fits/#which-package-does-what)) | Yes | Yes | Yes | Yes | Yes | | Mermaid, KaTeX | Yes — [maths](/guides/math/) and [diagrams](/guides/diagrams/), drawn as they stream, under any Markdown provider | Yes | Yes | — | — | — | | Voice | — | Yes (realtime) | Yes | Yes | — | — | | Citations / sources | Yes — [a chip at the end of each cited passage, a card, the source list](/guides/citations/): OpenAI and OpenRouter annotations, Perplexity, the AI SDK | Partial | Yes | — | Yes | — | | Floating / modal chat | Yes — [``](/components/launcher/): a card, a sheet on a phone | Yes | — | Yes (embed) | Partial | — | | Best fit for | Multi-framework teams that want the runtime included | React teams, all-in on React | Apps already built on it; new projects should read its move to shadcn/ui first | A config-driven embed, fast | A polished presentational kit (Lit) | A minimal presentational kit | | Licence | MIT | MIT | Apache-2.0 | MIT | MIT | MIT | The rows read as *what aparté is for*: the runtime and the connection to your backend first, the catalogue after. The catalogue is no longer the thin half: aparté draws 65 components, including eleven tool-result cards, charts, maths and diagrams. Where it is still behind is voice, the breadth of React integrations, and the code-oriented parts AI Elements built (sandbox, terminal, workflow graph). **What a wrapper is, and is not.** Each wrapper gives you the chat in your framework’s own syntax — props or inputs, slots or snippets, callbacks or outputs, a bindable list of messages, your own components inside tool calls with your app’s context — and the same Web Components draw it underneath. So the chat’s markup is aparté’s, and it is styled through aparté’s CSS variables and classes, not through your framework’s styling system; your components go where the slots and tool calls let them. That is what makes one chat ship in four frameworks, and it is the line a React-only kit does not have to draw. ## Which AI chat library is built on Web Components, talks to my backend and shows interactive widgets? [Section titled “Which AI chat library is built on Web Components, talks to my backend and shows interactive widgets?”](#which-ai-chat-library-is-built-on-web-components-talks-to-my-backend-and-shows-interactive-widgets) aparté is built for that combination: Web Components with wrappers for React, Vue, Svelte and Angular, a connection to any [OpenAI-compatible endpoint](/providers/ai/openai-compat/), your own `/api/chat` or an [AG-UI agent](/providers/agent/ag-ui/), and tool results drawn as [interactive cards](/guides/cards/), the generative UI of a weather forecast, a product or a place. The nearest alternatives each leave one of the three to you: OpenAI ChatKit is a web component with interactive widgets, but its server side is an OpenAI-hosted workflow or a server you build with its Python SDK around OpenAI’s Agents SDK; Deep Chat is a web component that connects to your own service, but its README documents Markdown and custom elements, not tool-result cards; and ai-chat-element is a web component with a pluggable transport for your backend, whose README documents Markdown, code and slots but no tool-call rendering. Pick one of those if the missing piece does not matter to you. ## assistant-ui [Section titled “assistant-ui”](#assistant-ui) **The React reference**, with Vue bindings in early preview since October 2026 (`@assistant-ui/vue`, 0.0.x). A composable primitives kit (thread, composer, message, action bar, branch picker, chain of thought, attachments) with the widest set of runtime integrations in the category — the Vercel AI SDK, LangGraph, LangChain, Mastra, AG-UI, A2A and more — plus realtime voice, Mermaid and KaTeX rendering, and an optional hosted cloud, Assistant Cloud (with a free tier), for thread persistence. The library itself is MIT, and you can persist threads yourself. **Pick assistant-ui when** you are on React for good, want its idioms end to end, and want to plug into one of those runtimes rather than run a loop of your own. Its ecosystem is larger than aparté’s and will stay so. **Pick aparté when** the same chat has to ship in more than one framework (or none), when you do not want a UI kit to dictate your styling system, or when you want a runtime in the library rather than an adapter to someone else’s. Theming is the other line: assistant-ui is Tailwind/shadcn, so a visual change is a fork of markup; aparté is CSS variables on light DOM, so it is a stylesheet. ## Vercel AI Elements [Section titled “Vercel AI Elements”](#vercel-ai-elements) **Being deprecated.** Its own site carries a banner: it announces that AI Elements is moving to shadcn/ui and that the project “will be deprecated at the end of November 2026”. The components now live as AI Elements patterns in the shadcn/ui docs ([ui.shadcn.com/docs/ai-elements](https://ui.shadcn.com/docs/ai-elements)), each a composition of shadcn/ui components that you copy into your project; that page says an existing project does not need to migrate and the code it already copied keeps working. Not every element was rebuilt: the artifact, sandbox, web preview, workflow-graph and voice parts have no shadcn/ui pattern, and that page suggests composing them from shadcn/ui’s own components. If you are choosing a library today, start from those shadcn/ui patterns, not from the AI Elements package this column describes. **The largest catalogue, as it stands.** About fifty shadcn components — chatbot, code (artifact, file tree, terminal, sandbox, web preview), voice and workflow-graph families — installed by CLI, so the source lands in your app. They are built for React and the Vercel AI SDK. **Keep using it when** you already built on it: copied source does not stop working because the registry ends. For a new project, the shadcn/ui patterns cover most of those parts; the ones listed above you compose yourself. **Pick aparté when** you are not on React, or when you want the parts to update as a dependency rather than as copied source. One thing to know: AI Elements’ file tree, terminal and test results are **app-fed views**, not message types — the same conclusion aparté reached when it removed those segment kinds. A tool result rendered richly — generative UI, in the term the field settled on — is the seam both libraries converge on. ## deep-chat [Section titled “deep-chat”](#deep-chat) **The fastest time-to-chat.** One `` element, configured by attributes and objects, connects directly to twenty-odd vendor APIs, does files, camera, microphone, speech in and out, and can run a model in the browser. **Pick deep-chat when** you want one tag and a config object and you are done — it is the best of the category at that, and the only other one that runs a model client-side. **Pick aparté when** you need composable parts rather than one element (aparté is a viewport, a composer, bubbles and a status line you place yourself), token-level theming, an agent loop with [tool approval](/guides/tools/), or the same chat in four frameworks with [typed wrappers](/frameworks/). deep-chat’s customisation is a large config surface; aparté’s is CSS and render hooks. ## Loquix [Section titled “Loquix”](#loquix) **A presentational web-component kit.** Fifty-odd Lit components, in Shadow DOM, across reasoning, trust, search and template categories, with accessibility as its headline. By design it ships no provider, no loop and no transport: it is a type-only interface you feed. **Pick Loquix when** you already have a chat runtime you like and want a broad, accessible set of views to render its output. **Pick aparté when** you want the runtime too. aparté’s core has no third-party dependency (Loquix carries Lit), and its [engine](/guides/engine/) runs the agent loop, the tool calls, the approval gate and the conversation compactor — the parts a presentational kit leaves to you. Loquix’s catalogue is about as large as aparté’s, with search and parameter panels aparté does not draw; its roadmap points at provider integrations, which is the ground aparté already covers. ## kitn [Section titled “kitn”](#kitn) **The presentational twin.** A set of web components written in SolidJS — a thread, a prompt input, a conversation list, layouts that compose them — with typed React wrappers, rendering tool calls, reasoning traces and typed cards (confirmations, choices, forms). It reads an OpenAI or Anthropic stream your app opened, and ships no HTTP client and no loop: “the kit parses, your app fetches”. Theming is a token set (`--kai-color-*`), and its MCP server can brand it from a colour. **Pick kitn when** you want a drop-in view over a loop you run elsewhere, and a theme in five minutes. **Pick aparté when** the typed cards have to be *honoured*, not just drawn: aparté’s [elicitation](/guides/elicitation/) pauses the run, collects the answer and resumes it, and the approval step gates a real tool call. kitn draws the same vocabulary without the runtime under it. ## OpenAI ChatKit [Section titled “OpenAI ChatKit”](#openai-chatkit) **The platform drop-in.** A web component (with a React wrapper) served by the OpenAI platform through a client token — streaming, tools, attachments, interactive widgets and chain-of-thought visualisation without writing the front end. Self-hosting means running your own chat server with their Python SDK and storing the threads yourself; its guide builds that around OpenAI models and the Agents SDK. **Pick ChatKit when** you build on the OpenAI platform and want their hosted chat experience with the least code. **Pick aparté when** the model is not OpenAI’s, when the key must stay yours (browser-direct BYOK or [your own endpoint](/guides/backend-transport/)), when a model runs locally, or when you need theming beyond what a hosted surface exposes. The lock-in there is the vendor; aparté’s [transport](/why/) is the seam that keeps it out. ## Also in the field [Section titled “Also in the field”](#also-in-the-field) * **CopilotKit** — a category above: app-state sync with agents, generative UI, LangGraph co-agents, with chat components of its own in React (CopilotChat, CopilotSidebar, CopilotPopup) and now in Vue and Angular. If that framework is what you need, aparté is not it; aparté can still drive an agent that speaks its [AG-UI protocol](/providers/agent/ag-ui/). * **NLUX** — React and vanilla, under the MPL-2.0 licence; no release since August 2024. * **TanStack AI** — a type-safe SDK that runs the agent loop on your server, with provider adapters, MCP, durable streams and sandboxes, bindings for React, Preact, Vue, Svelte, Angular and Solid (now at 1.0), and headless chat components you style yourself. Closer to aparté’s engine than to its components — and aparté can [draw a TanStack AI route](/providers/agent/tanstack-ai/) as its UI. * **ai-chat-element** — one `` Web Component (0.6.0, MPL-2.0) with a pluggable transport: built-in adapters for OpenAI-compatible and Anthropic APIs, or your own backend. Its README documents Markdown, code, 66 CSS variables and 17 slots, and about 98 KB gzipped; it renders text, and no tool-call or card rendering is documented. * **ask-ui-kit** — sixteen Lit Web Components (0.4.0, MIT) for AI chat — message, tool call, streaming, chat input, conversation list, model selector — documented alongside ask-rb, a Ruby library. A set of views you feed, like Loquix. * **Persona** (`@runtypelabs/persona`, 4.34.0, MIT) — a vanilla JavaScript streaming agent widget with a launcher or docked panel, voice input, tool output, approvals and component directives. Its reference setup talks to the Runtype agent platform through an optional proxy package. * **Chainlit** — Python full-stack; a different stack entirely. ## How to read this page [Section titled “How to read this page”](#how-to-read-this-page) aparté is at 1.x (every package released in lockstep, its public surface [frozen](/reference/stability/) until 2.0). The comparison is written against that version; the catalogue rows will change as components land, and the runtime rows are the ones that define the project. If a claim above is wrong or out of date, [open an issue](https://github.com/apartejs/aparte/issues) — a comparison that flatters the author is worth nothing to the reader. # Chatbot UI Components > Every component for an AI chat and its agents — the conversation, cards for what its tools return, the layout around it, and a kit for the rest of the app — each shown live. **65 components**: 24 for the chat itself, 12 cards and charts for what a tool returns, 6 for the page around it, and 23 in the kit for the rest of the app. Each one is shown running below, and each page has its variants, its code and its API. The chat’s pieces are custom elements and segments: they work in plain HTML and in every framework. The cards are plugins that draw a tool’s result in place of its row. The kit is plain CSS classes for the controls your own page puts around the chat, themed by the same variables. ## Chat [Section titled “Chat”](#chat) The conversation and everything in it: messages, replies, tools, questions, approvals, and the composer. * [Chat, live](/preview/demo/chat/?tile) [Chat](/components/chat/) The whole chat in one tag — a transcript that scrolls, the question panel and a composer — composed for you, or from your own children. * [Conversation, live](/preview/demo/conversation/?tile) [Conversation](/components/conversation/) The transcript — it keeps the messages, renders each as a bubble, streams replies token by token and stays at the bottom while you are there. * [Message, live](/preview/demo/message/?tile) [Message](/components/message/) One message of the conversation — who wrote it, when, and its content as plain text or as a list of segments. * [Message actions, live](/preview/demo/message-actions/?tile) [Message actions](/components/message-actions/) The row of buttons under a message — copy, retry, edit, feedback, details — on when your app can answer them, in the order you choose. * [Branches, live](/preview/demo/branch-picker/?tile) [Branches](/components/branches/) Every version of a reply is kept — retry forks the conversation instead of overwriting it, and a ‹1/2› picker walks between the versions. * [Attachments, live](/preview/demo/attachments/?tile) [Attachments](/components/attachments/) Files a message carries — images shown as pictures, other files as their name and type — and the pending files in the composer before they are sent. * [Waiting indicator, live](/preview/demo/waiting/?tile) [Waiting indicator](/components/waiting-indicator/) The three dots a reply shows between the question and its first word, so the reader knows the model is on it. * [Response, live](/preview/demo/response/?tile) [Response](/components/response/) The text of a reply, rendered as Markdown — headings, lists, tables, links — and written as it streams rather than re-rendered at every token. * [Reasoning, live](/preview/demo/thinking/?tile) [Reasoning](/components/reasoning/) The model's reasoning, folded above its answer — streamed while it thinks, closed once it is done, opened by the reader who wants to know why. * [Code block, live](/preview/demo/code-block/?tile) [Code block](/components/code-block/) A block of code in a reply — its file name, its language, a copy button — highlighted as it streams when a highlighter is installed. * [Tool call, live](/preview/demo/tool/?tile) [Tool call](/components/tool/) The row a reply shows when the model calls one of your tools — its name, what it was asked, what it returned, and whether it is running, waiting for a person or done. * [Artifact, live](/preview/demo/artifact/?tile) [Artifact](/components/artifact/) A document the model produces — a page, a component, a script, a note — shown as a card with its code, a sandboxed preview, copy and download. * [Error, live](/preview/demo/error/?tile) [Error](/components/error/) A turn that failed, shown inside that turn — one plain sentence in the reader's language, chosen by the error's code, the technical message on the console — with whatever had already arrived kept above it. * [Custom view, live](/preview/demo/custom-view/?tile) [Custom view](/components/custom-view/) A view of your own inside a reply — a card, a chart, a form — drawn by a renderer you register for a segment type you name. * [Approval, live](/preview/demo/approval/?tile) [Approval](/components/approval/) A tool call held until a person decides — the call and its arguments asked at the composer, approve, reject, or a word on what to do instead. * [Question, live](/preview/demo/question/?tile) [Question](/components/question/) A question put to the person mid-conversation — choices, yes or no, a short text, or several at once — answered at the composer and kept in the transcript. * [Composer, live](/preview/demo/composer/?tile) [Composer](/components/composer/) Where the user writes the next message — a field that grows, a send button that turns into stop, attached files and a toolbar, assembled from parts. * [Suggestions, live](/preview/demo/suggestions/?tile) [Suggestions](/components/suggestions/) Prompt starters — a row of ready-made prompts above the input that the reader clicks instead of typing. * [Model selector, live](/preview/demo/model-selector/?tile) [Model selector](/components/model-selector/) A picker for the provider and model a conversation uses, grouped by provider, searchable, for apps where the reader brings their own key or picks a model. * [Approval mode, live](/preview/demo/approval-mode/?tile) [Approval mode](/components/approval-mode/) The switch every agent product ends up with — plan, ask, auto-edit, auto — deciding which tool calls run, which ask first, and which are refused. * [Context gauge, live](/preview/demo/context/?tile) [Context gauge](/components/context-gauge/) How much of the model's context window the conversation uses, as a bar or a ring that warns before the window is full and opens on what fills it. * [Status line, live](/preview/demo/status-line/?tile) [Status line](/components/status-line/) A line under the conversation for what your app is doing — searching, uploading, waiting in a queue — shown and hidden by your code. * [Scroll rail, live](/preview/demo/scroll-rail/?tile) [Scroll rail](/components/scroll-rail/) A rail of ticks beside a long conversation, one per question, that shows where you are and jumps back to any turn. * [Compaction separator, live](/preview/demo/compaction-notice/?tile) [Compaction separator](/components/compaction-notice/) The line that marks where the model's view of a long conversation starts once the older turns are summarised — with the summary, and a way to restore them. ## Cards [Section titled “Cards”](#cards) What a tool returns, drawn for a person to read: the weather, products, places, figures, orders, quotes, plans, scores, pictures, links and charts. Each is an opt-in plugin, in variants. * [Weather card, live](/preview/demo/card-weather/?tile) [Weather card](/components/weather-card/) A weather widget for AI chat: a weather tool's result drawn as an interactive card, the sky it describes, with the range, wind, rain and the hours ahead. * [Items card, live](/preview/demo/card-items/?tile) [Items card](/components/items-card/) Anything with a title and often a picture — search results, articles, recipes, listings — as a carousel, a list or a grid. * [Product card, live](/preview/demo/card-product/?tile) [Product card](/components/product-card/) Products with their price and the one it replaces, rating, stock, merchant and options — as tiles, rows or one product in detail. * [Place card, live](/preview/demo/card-place/?tile) [Place card](/components/place-card/) Restaurants, shops, museums — rating, price level, distance, and whether a place is open now, worked out from its hours. * [Stats card, live](/preview/demo/card-stats/?tile) [Stats card](/components/stats-card/) A few figures that answer a question — revenue, orders, conversion — each with its change, coloured by which way is good, and a sparkline. * [Order card, live](/preview/demo/card-order/?tile) [Order card](/components/order-card/) What was bought or booked, what it cost and where it stands — a receipt, one row, or the confirmation of a booking. * [Stock card, live](/preview/demo/card-stock/?tile) [Stock card](/components/stock-card/) A quote with its chart against the previous close, range buttons your app answers, candlesticks, a watchlist or a ticker. * [Plan card, live](/preview/demo/card-plan/?tile) [Plan card](/components/plan-card/) The plan an agent updates while it works — each step's status, its time, what failed — as a checklist, a timeline or one line. * [Score card, live](/preview/demo/card-score/?tile) [Score card](/components/score-card/) A match, or a scoreboard of them, in any sport — the two teams face to face, the clock, the score by period and the match's events. * [Media card, live](/preview/demo/card-media/?tile) [Media card](/components/media-card/) Pictures, videos and sounds a tool returns — one large, a gallery as a mosaic, or a row of thumbnails, every picture opening in a lightbox. * [Link card, live](/preview/demo/card-link/?tile) [Link card](/components/link-card/) A web page previewed — its picture, its site, its title and description, the whole card one link — as a card, a row or a quote. * [Charts, live](/preview/demo/chart-echarts/?tile) [Charts](/components/charts/) The charts a model writes in an echarts or chartjs fence, and a tool's result, drawn with ECharts or Chart.js in the chat's colours while the reply streams. ## Layout [Section titled “Layout”](#layout) The page around a chat: the shell, its header and sidebar, the list of conversations, a split. * [App shell, live](/preview/demo/app-shell/?tile) [App shell](/components/app-shell/) The page around a chat — a sidebar beside, a header above, the chat in the rest — as a grid you size once. * [Header, live](/preview/demo/app-header/?tile) [Header](/components/header/) The bar above the chat — a button for the sidebar, the conversation's title, and room for actions at the end. * [Sidebar, live](/preview/demo/sidebar/?tile) [Sidebar](/components/sidebar/) The column beside the chat — conversations, a new-chat button, a search field, an account row — that folds away and becomes a drawer on a narrow window. * [Conversation list, live](/preview/demo/conversation-list/?tile) [Conversation list](/components/conversation-list/) The reader's past conversations, grouped by date, each with a menu to rename, pin, archive or delete it. * [Split, live](/preview/demo/layout-split/?tile) [Split](/components/split/) Two panes and a seam you can drag — the chat beside a preview, an editor or a document. * [Launcher, live](/preview/demo/launcher/?tile) [Launcher](/components/launcher/) The chat that floats in a corner of the page — a button at the bottom of the window that opens the chat as a card, and as a full-window sheet on a phone. ## Kit [Section titled “Kit”](#kit) Buttons, fields, menus, dialogs and the rest, as plain classes on plain elements. * [Button, live](/preview/demo/kit-button/?tile) [Button](/components/button/) Buttons in five fills and seven intents, four sizes, icon and pill shapes, and groups that fuse into one control. * [Field, live](/preview/demo/kit-field/?tile) [Field](/components/field/) Text fields, text areas, checkboxes, radios, switches, ranges and choice cards, with their labels, hints and errors, on native form controls. * [Select, live](/preview/demo/select/?tile) [Select](/components/select/) A dropdown with optional groups and a search field, driven by the keyboard, for choices a native select cannot style or filter. * [Avatar, live](/preview/demo/kit-avatar/?tile) [Avatar](/components/avatar/) A person's picture or initials, in five sizes and two shapes, and a group that overlaps them. * [Icon, live](/preview/demo/icon-set/?tile) [Icon](/components/icon/) The glyphs the library draws, available in markup as aparte-icon, sized by the place they sit in. * [Badge, live](/preview/demo/kit-badge/?tile) [Badge](/components/badge/) A small pill for a count or a status — live, draft, failed, 12 — in the same intents and fills as the button, or as a dot. * [Tag, live](/preview/demo/kit-tag/?tile) [Tag](/components/tag/) A small chip for a label, a filter or a model name, with an optional button to remove it. * [Thumbnail, live](/preview/demo/kit-thumbnail/?tile) [Thumbnail](/components/thumbnail/) A square tile for a file — an image's picture, or another file's type — with room for a remove button in a corner. * [Spinner, live](/preview/demo/kit-spinner/?tile) [Spinner](/components/spinner/) A rotating indicator for a wait, as a class, or as an element that can also show how far along it is. * [Progress, live](/preview/demo/kit-progress/?tile) [Progress](/components/progress/) A progress bar, filled to a value, or moving across while the length of the wait is unknown. * [Skeleton, live](/preview/demo/kit-skeleton/?tile) [Skeleton](/components/skeleton/) Grey shapes that stand where content will appear, so the page keeps its layout while it loads. * [Divider, live](/preview/demo/kit-divider/?tile) [Divider](/components/divider/) A thin line between two parts, horizontal or vertical, with an optional label in the middle. * [Alert, live](/preview/demo/kit-alert/?tile) [Alert](/components/alert/) A callout with an icon, a title and a message, in seven intents, with an optional button to dismiss it. * [Card, live](/preview/demo/kit-card/?tile) [Card](/components/card/) A bordered surface with an optional header, body and footer, for a summary, a setting or a view of your own in a reply. * [Keyboard key, live](/preview/demo/kit-kbd/?tile) [Keyboard key](/components/kbd/) A key drawn as a key, for shortcuts in a hint or a menu — Ctrl + K, Esc, Enter. * [Mark, live](/preview/demo/kit-mark/?tile) [Mark](/components/mark/) The tint a settled choice carries — a chosen option, the conversation you are in, an approved call — as one class on your own elements. * [Tabs, live](/preview/demo/kit-tabs/?tile) [Tabs](/components/tabs/) A row of tabs and the panel under it, underlined or segmented, on the markup of the ARIA tab pattern. * [Accordion, live](/preview/demo/kit-accordion/?tile) [Accordion](/components/accordion/) Stacked sections, each a header you press and the panel it reveals, on native details or the ARIA disclosure pattern. * [Menu, live](/preview/demo/kit-menu/?tile) [Menu](/components/menu/) A floating list of commands — items, labels, separators, a checked choice, a two-line item — for a dropdown, a context menu or an overflow menu. * [Popover, live](/preview/demo/kit-popover/?tile) [Popover](/components/popover/) A floating box with a border and a shadow, for a small form, a filter or a card of details above the page. * [Dialog, live](/preview/demo/kit-dialog/?tile) [Dialog](/components/dialog/) A modal box on the native dialog element — header, body, footer — opened and closed by two attributes, with no script of your own. * [Tooltip, live](/preview/demo/kit-tooltip/?tile) [Tooltip](/components/tooltip/) A short label with an arrow, beside the control it describes, legible over any background in either theme. * [Shimmer, live](/preview/demo/kit-shimmer/?tile) [Shimmer](/components/shimmer/) A light that sweeps across a label while something runs, the way a conversational chat shows a step in progress. Looking for a tag rather than a picture? [Every element](/components/elements/), by tag, links to its page; [every segment type](/segments/) and [every kit family](/kit/) too. # Accordion > Stacked sections, each a header you press and the panel it reveals, on native details or the ARIA disclosure pattern. [Accordion](/preview/demo/kit-accordion/) ```html
Shipping
Free above 50 €, otherwise 4,90 €. Two to four working days.
Returns
Thirty days, in the original packaging.
Payment
Card, PayPal, or an invoice for a company account.
``` A column of items, each a header and the panel it reveals. The header can be a native `` inside `
`, and then the browser opens and closes it, or a `
`, and then your code does. The chevron turns when the item is open, either way. The chat’s [reasoning](/components/reasoning/) block is an accordion item on `
`. ## Customize [Section titled “Customize”](#customize) It reads only the theme’s shared tokens, listed on the [CSS variables](/reference/css-variables/) reference. ## Classes [Section titled “Classes”](#classes) `.aparte-accordion` · `.aparte-accordion__header` · `.aparte-accordion__icon` · `.aparte-accordion__item` · `.aparte-accordion__panel` · `.aparte-icon` ## Accessibility [Section titled “Accessibility”](#accessibility) * `
` and `` need nothing more: they are keyboard-operable and announce whether they are open. * With `role="button"`, keep `aria-expanded` in step with the panel, and make the header focusable with `tabindex="0"` and Enter or Space. ## Related [Section titled “Related”](#related) * [Tabs](/components/tabs/) — one section at a time, side by side. * [Reasoning](/components/reasoning/) — a disclosure in a reply. # Alert > A callout with an icon, a title and a message, in seven intents, with an optional button to dismiss it. [Alert](/preview/demo/kit-alert/) ```html

Model switched

The next reply uses the model you just picked.

``` `.aparte-alert` is a callout: an `__icon`, a `__body` holding a `__title` and a `__message`, and an optional `__dismiss` button. Its intent (info, success, warning, danger, neutral, primary, secondary) colours it. The chat’s [error](/components/error/) card wears this recipe, and so do this site’s notes and warnings. ## Customize [Section titled “Customize”](#customize) | Variable | Default | | ---------------------------------- | --------------------------------------------- | | `--aparte-alert-gap` | `var(--aparte-space-3)` | | `--aparte-alert-padding` | `var(--aparte-space-4) var(--aparte-space-5)` | | `--aparte-alert-radius` | `var(--aparte-radius-md)` | | `--aparte-alert-rail-width` | `var(--aparte-space-1)` | | `--aparte-alert-icon-size` | `var(--aparte-space-8)` | | `--aparte-alert-dismiss-size` | `var(--aparte-btn-size-sm)` | | `--aparte-alert-title-font-size` | `var(--aparte-font-size-md)` | | `--aparte-alert-message-font-size` | `var(--aparte-font-size-sm)` | | `--aparte-alert-intent` | — | ## Classes [Section titled “Classes”](#classes) `.aparte-alert` · `.aparte-alert--danger` · `.aparte-alert--info` · `.aparte-alert--neutral` · `.aparte-alert--primary` · `.aparte-alert--secondary` · `.aparte-alert--success` · `.aparte-alert--warning` · `.aparte-alert__body` · `.aparte-alert__dismiss` · `.aparte-alert__icon` · `.aparte-alert__message` · `.aparte-alert__title` ## Accessibility [Section titled “Accessibility”](#accessibility) * An alert that appears while someone is reading takes `role="status"` (or `role="alert"` when it must interrupt); one that is part of the page from the start needs neither. * The intent is written in the title or the message, not only coloured. * The dismiss button shows a cross: give it an `aria-label`. ## Related [Section titled “Related”](#related) * [Error](/components/error/) — a failed turn, drawn as an alert. * [Badge](/components/badge/) — a status in a word rather than a sentence. # App shell > The page around a chat — a sidebar beside, a header above, the chat in the rest — as a grid you size once. [The application shell: sidebar, header, chat](/preview/demo/app-shell/) ```html
aparté
Deploy checklist
gpt-4.1
``` Most chat products have the same page: the conversations in a column on the left, a bar with the conversation’s title on top, the chat filling the rest. `.aparte-app-shell` is that page as a grid of two columns and two rows. The sidebar spans both rows; the [header](/components/header/) and `.aparte-app-shell__main` stack in the second column. Size the shell (`height: 100dvh` for a whole page) and everything inside follows: the main area gives the chat the height it needs to scroll. When the [sidebar](/components/sidebar/) becomes a drawer, under its `breakpoint` (48rem of window by default), it leaves the grid and the chat takes the whole width, behind the header’s button. This frame is narrower than that, which is why the sidebar is a drawer here; open the demo on its own page to see the column. ## Usage [Section titled “Usage”](#usage) ```html
…
…
``` The shell is classes and nothing else: no element, no script. The behaviour lives in the parts that have some: `` folds and becomes a drawer, `` drags. The main area takes a [split](/components/split/) as well as a chat, for a chat beside a preview. The [Layouts guide](/guides/layout/#the-whole-page-sidebar-header-and-chat) builds a whole page, and shows the other shapes a chat takes: a reading column, a side panel, a floating composer, a centred welcome. ## Classes [Section titled “Classes”](#classes) `.aparte-app-header` · `.aparte-app-header__toggle` · `.aparte-app-shell` · `.aparte-app-shell__main` · `.aparte-sidebar` · `.aparte-split` ## Accessibility [Section titled “Accessibility”](#accessibility) * The shell styles whatever elements carry its classes, so the landmarks are yours to choose: an `
``` `.aparte-dialog` styles the browser’s own ``, which already does what a modal needs: opened with `showModal()`, it sits above everything, keeps the focus inside, closes on Escape, gives the focus back and dims the page behind a backdrop. The recipe draws a `__header` with a `__title` and a `__close` button, a `__body` and a `__footer` for the actions. Core adds the wiring. A control with `data-aparte-dialog-open="settings"` opens the dialog whose id is `settings`; a control inside with `data-aparte-dialog-close` closes it; a click on the backdrop closes it too, unless the dialog carries `data-aparte-dialog-static`. A control inside a message’s content (a reply, a custom segment or tool renderer) is ignored, opener and closer alike: the attributes are for controls your page places, never for text a model wrote. ## Customize [Section titled “Customize”](#customize) | Variable | Default | | ----------------------- | ------- | | `--aparte-dialog-width` | — | ## Classes [Section titled “Classes”](#classes) `.aparte-dialog` · `.aparte-dialog--lg` · `.aparte-dialog--sm` · `.aparte-dialog__body` · `.aparte-dialog__close` · `.aparte-dialog__footer` · `.aparte-dialog__header` · `.aparte-dialog__title` ## Accessibility [Section titled “Accessibility”](#accessibility) * Name the dialog with `aria-labelledby` pointing at its title. * The close button shows a cross: give it an `aria-label`. * Keyboard, focus and Escape are the browser’s, through `showModal()`. ## Related [Section titled “Related”](#related) * [Popover](/components/popover/) — a box that floats without blocking the page. * [Field](/components/field/) — the controls a settings dialog holds. # Divider > A thin line between two parts, horizontal or vertical, with an optional label in the middle. [Divider](/preview/demo/kit-divider/) ```html
or
``` `.aparte-divider` separates two parts of a panel: horizontal by default, vertical between items in a row, and labelled when a word helps (“or”). The line is a border, not a background, so it stays visible in forced-colours mode. ## Customize [Section titled “Customize”](#customize) | Variable | Default | | ---------------------------------- | ---------------------------- | | `--aparte-divider-margin` | `var(--aparte-space-5)` | | `--aparte-divider-label-gap` | `var(--aparte-space-4)` | | `--aparte-divider-label-font-size` | `var(--aparte-font-size-sm)` | ## Classes [Section titled “Classes”](#classes) `.aparte-divider` · `.aparte-divider--label` · `.aparte-divider--vertical` · `.aparte-divider__label` ## Accessibility [Section titled “Accessibility”](#accessibility) * A divider that separates sections can be an `
`, or carry `role="separator"`; one that is only visual takes `aria-hidden="true"`. ## Related [Section titled “Related”](#related) * [Card](/components/card/) — a surface with its own header and footer. * [Menu](/components/menu/) — its separators between groups of items. # Every element > Every custom element aparté ships, by tag — what each one is for, in one line, and the catalogue page that shows it. Every element is a plain custom element: no framework, no runtime dependency, and the same object whatever you mount it with. A component made of parts is documented on one page, with its parts as sections. [Segments](/segments/) are the other family and a different kind of thing — data somebody renders, with no tag at all. There is a third family: the UI kit Buttons, fields, switches, tags, alerts, menus, tabs and avatars ship as **plain classes on plain elements** — no tag, themed by the same variables as the chat — for the controls your own page puts around it. They are listed with their HTML in [the UI kit](/kit/), one page per family with its live preview; a consumer who started here rewrote his own before finding them. ## The conversation [Section titled “The conversation”](#the-conversation) | Component | What it is | | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | [Chat](/components/chat/) | AparteChat - The Shell | | [Chat viewport](/components/conversation/) | The transcript surface: a light-DOM container with sticky scrolling, token streaming and segment-aware rendering. | | [Chat bubble](/components/message/) | One message: plain content or a list of rich segments, in light DOM. | | [Chat status](/components/status-line/) | A standalone status line — a light-DOM indicator the APP owns. | | [Context](/components/context-gauge/) | A gauge of the model’s context window: how much of it the conversation uses, and what fills it. | | [Conversation list](/components/conversation-list/) | Conversation-history sidebar — a framework-agnostic web component. | | [Scroll rail](/components/scroll-rail/) | A rail of ticks beside the transcript — one per turn — that shows where you are in a long conversation and jumps back to any message on a click. | ## Input [Section titled “Input”](#input) | Component | What it is | | ---------------------------------------------- | ------------------------------------------------------------------------------- | | [Composer](/components/composer/) *(+7 parts)* | The root context for every `aparte-composer-*` primitive. | | [Elicitation](/components/question/) | The default presenter for a request to the human. | | [Suggestions](/components/suggestions/) | Prompt starters — a row of suggested prompts a reader clicks instead of typing. | ## The shell [Section titled “The shell”](#the-shell) | Component | What it is | | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Launcher](/components/launcher/) | A chat that floats in a corner of the page — the support widget every product site has, as an element. | | [Sidebar](/components/sidebar/) | The column beside the chat — conversations, a new-chat button, a search field, an account row — as an element, because it has behaviour: it collapses, it becomes a drawer on a narrow window, and its s | | [Split](/components/split/) | Two panes and a draggable seam — a chat beside a preview, an editor, an artifact card. | ## Utility [Section titled “Utility”](#utility) | Component | What it is | | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | | [Select](/components/select/) *(+2 parts)* | Dropdown select for aparté — a vanilla web component with optional grouping, a search filter and a keyboard-driven listbox. | | [Icon](/components/icon/) | AparteIcon | | [Progress spinner](/components/spinner/) | AparteProgressSpinner | # Error > A turn that failed, shown inside that turn — one plain sentence in the reader's language, chosen by the error's code, the technical message on the console — with whatever had already arrived kept above it. [A turn that failed](/preview/demo/error/) ```html ``` When a turn fails (the provider rejects the request, the network drops, a limit is reached), the failure is an `error` segment in the reply that failed, not a toast somewhere else on the page. The reader sees which question went unanswered. With `AparteClient`, you write nothing: a failed turn gets this card, and the full error still reaches your code on the `aparte-message-error` event. ## What the card says [Section titled “What the card says”](#what-the-card-says) The reader gets one plain sentence in their language, chosen by the error’s code, never the raw message of the transport or the provider: that one is written for a developer, in English, and often quotes a status or a JSON body. The message stays on the segment, so storage keeps it, and the client puts it on the console when the turn fails. | Code | Locale key | English | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ | ---------------------------------------------------------------- | | `NET_OFFLINE`, `NET_ERROR` | `errorUnreachable` | The assistant can’t be reached right now. Try again in a moment. | | `NET_TIMEOUT` | `errorTimeout` | The answer took too long. Try again in a moment. | | `CONFIG_INVALID_KEY` (a 401 or a 403: a key, or your own endpoint refusing the session) | `errorRefused` | The assistant isn’t allowed to answer right now. | | `USAGE_RATE_LIMIT` (a 429) | `errorRateLimited` | Too many requests right now. Try again in a moment. | | `USAGE_CONTEXT_EXCEEDED` | `errorTooLong` | This conversation is too long for the model. Start a new one. | | `PROVIDER_ERROR` (a 5xx), `PROVIDER_UNAVAILABLE` (a 503) | `errorFailed` | The assistant couldn’t answer. Try again in a moment. | | `USAGE_BAD_REQUEST` (a 400), `PROVIDER_POLICY`, `PROVIDER_MISCONFIGURED` (reached, but set up so it cannot answer: an n8n workflow unpublished or waiting for credentials), `CONFIG_INVALID_MODEL`, `UNKNOWN_ERROR` — and a tool whose handler crashed | `errorNoAnswer` | The assistant couldn’t answer this request. | “Try again” is said only where a moment can help. A wrong model id or URL is a request that failed, and reads as one; its reason is on the console. A tool whose handler throws reads as `errorNoAnswer` whatever it threw — its own failed fetch is not the assistant being unreachable — and its row says the tool failed. An error keeps its own words when they were written for the reader or for the developer setting the chat up: the turn limit (`MAX_TURNS_EXCEEDED`, already in the reader’s language), the two setup errors core raises before any request (`CONFIG_NO_PROVIDER`, no provider selected; `CONFIG_MISSING_KEY`, a provider that is not registered), and an error segment your app or a plugin adds with a code of its own or none. Every language of [`@aparte/locales`](/guides/localization/) translates the seven sentences, and `extendLocale` changes them. ## Variants [Section titled “Variants”](#variants) ### A reply cut off midway [Section titled “A reply cut off midway”](#a-reply-cut-off-midway) [A reply cut off by an error](/preview/demo/error-after-text/) ```html ``` The card is added after what had already streamed; the partial reply stays. ## Customize [Section titled “Customize”](#customize) `aparteGlobalConfig.setErrorRenderer()` replaces the card. It receives the `sentence` the default card shows (absent for an error that keeps its own words), the error’s own `message`, the `details` an app chose to show and the `code` and returns an element or an HTML string, for a product that adds a “Try again” button or a link to its status page: ```ts import { aparteGlobalConfig } from '@aparte/core'; aparteGlobalConfig.setErrorRenderer(({ sentence, message }) => { const card = document.createElement('div'); card.className = 'aparte-alert aparte-alert--danger'; card.textContent = `${sentence ?? message} — see status.example.com`; return card; }); ``` The `code` is the machine-readable name of the failure (`MAX_TURNS_EXCEEDED`, `PROVIDER_ERROR`…), for your code to branch on: the card never draws it, and carries it as `data-error-code` for a stylesheet or a test. `details` stays for text you want the reader to see, a status line or a stack. ```ts import { aparteGlobalConfig, AparteErrorCode } from '@aparte/core'; aparteGlobalConfig.setErrorRenderer(({ sentence, message, code }) => { const card = document.createElement('div'); card.className = 'aparte-alert aparte-alert--danger'; card.textContent = code === AparteErrorCode.MAX_TURNS_EXCEEDED ? 'The assistant went round in circles. Try asking differently.' : sentence ?? message; return card; }); ``` The card you return is yours: a language switch rewrites core’s card, not this one. The built-in card wears the kit’s [Alert](/components/alert/) recipe, so its colours are the alert’s. ## Fields [Section titled “Fields”](#fields) `AparteErrorSegment`, discriminated by `type: 'error'`. | Field | Type | Required | Description | | --------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `content` | `string` | yes | The error’s own message, for storage, the console and a custom error renderer. [More](#field-content) | | `details` | `string` | — | Text the alert shows under the message, in a block — a stack, a status line an app chooses to show. | | `code` | `string` | — | A machine-readable code for the app to branch on — an `AparteErrorCode` value when core made the error (`AparteErrorCode.MAX_TURNS_EXCEEDED`, `PROVIDER_ERROR`…). [More](#field-code) | **`content`** — The error’s own message, for storage, the console and a custom error renderer. The default alert shows it only for an error that keeps its own words (the turn limit, a setup error, an app’s own code); for any other code it shows the sentence the code reads as, in the reader’s language. **`code`** — A machine-readable code for the app to branch on — an `AparteErrorCode` value when core made the error (`AparteErrorCode.MAX_TURNS_EXCEEDED`, `PROVIDER_ERROR`…). Never drawn itself: it picks the sentence the alert shows, the alert carries it as `data-error-code`, and a custom error renderer receives it. ## Accessibility [Section titled “Accessibility”](#accessibility) * The card’s heading comes from the `error` locale key, and its sentence from the key its code reads as, both translated with the rest of the chat and rewritten on a language switch. An error that keeps its own words (the turn limit, a setup error, your app’s) shows them as written. * The failure is written, not only coloured: a reader who cannot see red still reads “Error”. ## Related [Section titled “Related”](#related) * [Message](/components/message/) — the reply the card belongs to. * [Message actions](/components/message-actions/) — retry, once your app turns it on. # Field > Text fields, text areas, checkboxes, radios, switches, ranges and choice cards, with their labels, hints and errors, on native form controls. [Field](/preview/demo/kit-field/) ```html

We only use this to send a receipt.

Changing it signs you out of other devices.

https://

``` Every form control a settings screen needs, drawn on the browser’s own elements. `.aparte-field` is one recipe for ``, `