Chat

Pro

The AI conversation thread, the second piece of the AI module. The assistant answers as a document, the Notion and ChatGPT style; the user turn stays a bubble. Streaming and reasoning included.

Explain how the density system works in this codebase.

Density is a single axis, comfortable or compact, that flows through React context so every component sizes from one source of truth.

How it works

  • DensityProvider puts the active density on the context.
  • Components read it with the useDensity hook.
  • Each maps the value to its own spacing, hit areas, and font size.

Why a context

  • One toggle re-densifies a whole subtree, with no prop drilling.
  • Marketing and app shells can run different densities side by side.

Try it yourself. This one is live, and its code is right below.

Explain how the density system works in this codebase.

Density is a single axis, comfortable or compact, that flows through React context so every component sizes from one source of truth.

How it works

  • DensityProvider puts the active density on the context.
  • Components read it with the useDensity hook.
  • Each maps the value to its own spacing, hit areas, and font size.

Why a context

  • One toggle re-densifies a whole subtree, with no prop drilling.
  • Marketing and app shells can run different densities side by side.

Installation#

# One-time setup (tokens + lib helpers)npx koalaui-cli@latest init# Activate your Pro license (once per machine)npx koalaui-cli@latest login <key># Add this component (its dependencies come along)npx koalaui-cli@latest add chat

Usage#

This example is part of Koala UI Pro

The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.

Have a license? Unlock it here

Anatomy#

Every part is a named export, never dot-notation, so each one crosses the server and client boundary cleanly. Conversation is the scrollable thread; each Message carries its role to its parts through context, so one prop drives the side, tint, and meta alignment. Compose only the parts a turn needs.

import {  Conversation,  ConversationScrollButton,  Message,  MessageAvatar,  MessageBody,  MessageHeader,  MessageName,  MessageTime,  MessageReasoning,  MessageReasoningTrigger,  MessageReasoningElapsed,  MessageReasoningContent,  MessageReasoningStep,  MessageReasoningFiles,  MessageReasoningFile,  MessageReasoningFilesMore,  MessageReasoningQueries,  MessageReasoningQuery,  MessageReasoningSources,  MessageReasoningSource,  MessageContent,  MessageTyping,  MessageBranch,  MessageBranchContent,  MessageBranchPrevious,  MessageBranchCount,  MessageBranchNext,  MessageError,  MessageErrorRetry,  MessageErrorDetails,  MessageFeedback,  MessageFeedbackUp,  MessageFeedbackDown,  MessageFeedbackReasons,  MessageActions,  MessageAction,  MessageFollowUps,  MessageFollowUp,} from "@/components/ui/chat"<Conversation>  <Message>    <MessageAvatar />    <MessageBody>      <MessageHeader>        <MessageName />        <MessageTime />      </MessageHeader>      <MessageReasoning>        <MessageReasoningTrigger>          <MessageReasoningElapsed />        </MessageReasoningTrigger>        <MessageReasoningContent>          <MessageReasoningStep>            <MessageReasoningQueries>              <MessageReasoningQuery />            </MessageReasoningQueries>            <MessageReasoningSources>              <MessageReasoningSource />            </MessageReasoningSources>            <MessageReasoningFiles>              <MessageReasoningFile />              <MessageReasoningFilesMore />            </MessageReasoningFiles>          </MessageReasoningStep>        </MessageReasoningContent>      </MessageReasoning>      <MessageBranch>        <MessageBranchContent>          <MessageTyping>            <MessageTypingNote />          </MessageTyping>        </MessageBranchContent>        <MessageError>          <MessageErrorRetry />          <MessageErrorDetails />        </MessageError>        <MessageFeedback>          <MessageActions>            <MessageBranchPrevious />            <MessageBranchCount />            <MessageBranchNext />            <MessageAction />            <MessageFeedbackUp />            <MessageFeedbackDown />          </MessageActions>          <MessageFeedbackReasons />        </MessageFeedback>      </MessageBranch>      <MessageFollowUps>        <MessageFollowUp />      </MessageFollowUps>    </MessageBody>  </Message>  <ConversationScrollButton /></Conversation>

Roles#

A message's role is the only switch. assistant aligns left with an avatar and a muted bubble; user aligns right with a solid blue bubble. Both use a soft, uniform radius on all four corners.

Why is pnpm build failing on CI but not locally?
K
CI runs Node 18, but the config calls structuredClone, which only landed in Node 20. Bump the workflow to Node 20 and the build passes.

With avatar (bubble)#

The default is the document style above. For a chat with an identity, the “robotized” look, set variant="bubble" on the Conversation: every turn gets a bubble, and you pair the assistant with a MessageAvatar, name, time, and actions. A per-message variant overrides the conversation default.

Add an empty state to the data table when there are no rows.
K
Koala2:34 PM

Done. I dropped an EmptyState into the table body:

  • Renders when rows.length === 0.
  • Reuses our EmptyState (icon, title, action).
  • Stays hidden while loading so the skeleton shows.
Nice. Now wire it to the loading prop.
K
Thinking

Rich content#

MessageContent is markup-agnostic. For a model reply, put Markdown in it: it takes the message's streaming and keeps half-written syntax off screen. Plain text or markup of your own works too: the bubble styles paragraphs, headings, lists, tables, quotes, code and links, tinted to read on either bubble.

K

Define the component recipe with tv and read its variants like this:

const button = tv({
  base: "inline-flex items-center justify-center",
  variants: { size: { sm: "h-8 px-3", md: "h-10 px-4" } },
})

See the foundations for the full house style.

Actions#

MessageActions holds a row of MessageAction buttons for copy and regenerate. Each wraps our Button, so it inherits the focus ring and a tooltip drawn from its aria-label. Thumbs, version arrows and retry have their own parts, below.

K
I dropped forwardRef from Button and now pass ref as a regular prop, per the React 19 rule. Want me to apply the same change across the other primitives?

Branches#

After a regenerate or an edit, a turn holds several versions of the answer. MessageBranch keeps the active one and MessageBranchContent renders it from its children, one child per version. The pager fits in the actions row: previous and next disable at the ends, the count reads “2/3” and announces “Version 2 of 3”, and all three hide while there is only one version. Switching slides the new version in from the side you moved toward; under reduced motion it only fades. Uncontrolled, it follows the newest version; control index to jump to a fresh regenerate. If only the active version lives on the client, pass count and render that one child. Press regenerate to add a fourth.

How do I stop the wrong theme flashing on first load?
Store the choice in a cookie instead of localStorage. The server reads it and renders the right class into the HTML, so the first paint is already correct.

Feedback#

MessageFeedback wraps the actions row and holds the vote. MessageFeedbackUp and MessageFeedbackDown are toggles (aria-pressed): the picked one sits on a faint chip, in ink (the thumbs up also fills its glyph, the thumbs down keeps its outline), and pressing it again takes the vote back. A thumbs down opens MessageFeedbackReasons in a popover pinned to the thumb, so the thread stays put: reason chips, an optional comment and Submit. Escape or a click away closes it and keeps the vote. Once sent, a thank you shows in the popover before it folds away; a thumbs up only fills its glyph.

Your invoice is ready. The Pro plan renews on December 1 at $149, and the two seats you added last week are prorated on this bill.

Error#

When a reply fails, put a MessageError where the content would be. The message is a polite sentence about what happened, announced as an alert; its children line up under it. MessageErrorRetry sends the turn again and MessageErrorDetails folds the raw error (status, request id) behind a Details toggle, for support and bug reports.

Summarize the churn numbers from last quarter.

Typing indicator#

Until the first words arrive, put a MessageTyping straight in the MessageBody: one quiet line with the same arc as the reasoning trigger, so the chat has a single loader. Pass the current step as label and it swaps in place; elapsed counts the seconds, and MessageTypingNote children list what the model has found so far. When the answer starts, the line hands over to a MessageReasoningTrigger that reads “Thought for 4s”.

Nice. Now wire it to the loading prop.
K
Reading the table

A person typing#

In a chat between people, set indicator="dots": three dots pulse in turn in place of the agent arc. Name who is typing in the label, so the status reads the same out loud.

L
Lena Fischer10:12
The new pricing page is up on staging. Can you take a look?
On it. Is the annual toggle in yet?
L
Lena is typing

Streaming text#

Once the first words arrive, swap the typing line for the text and pass streaming to MessageContent. The bursts a model sends come out at a steady reading pace, nothing fades, blurs or blinks, and only the freshest words come in lighter and settle to full ink as newer ones push them back. Before a new paragraph the pace waits for that ink to dry, and once the answer is done the last words settle and the text goes back to plain markup. Under reduced motion the pace stays and the ink is full from the start. Plain string children and a Markdown inside both stream this way.

Follow-ups#

Suggested next prompts under an answer, the way Grok and Perplexity offer them. MessageFollowUps is a labelled list and each MessageFollowUp a quiet Button that wraps long lines. Send the text as is on click, and keep them on the latest answer only: under an older one they no longer say what they refer to.

The release notes are drafted: three fixes, one new component and a token rename.

Reasoning#

The collapsible “thinking” block, the way Claude and ChatGPT show it. While streaming a small spinner turns beside the label and the trigger reads “Investigating…”; once done, it settles to a summary like “Investigated 14 sources” that anyone can expand, and the spinner closes into a check. For a simple answer, pass plain text; for an agentic run, the block becomes a log of what it did. Group each phase in a MessageReasoningStep (an optional label captions it, a dot pins onto the rail so a column reads as a timeline, and status="active" pulses the in-progress one). Show the searches it ran with MessageReasoningQuery and the URLs it consulted with MessageReasoningSource, as compact favicon and domain chips by default or a bordered title list via layout="list". The domain and favicon are derived from the href. Built on Radix Collapsible, so keyboard and ARIA come for free. Press Ask again to watch it stream through the phases.

Dark mode flashes the wrong theme on first load. Can you trace the hydration flicker?
K

Reproducing the flash of the wrong theme. The theme looks read on the client after hydration, so the first paint always uses the default.

Searching the codebase
useTheme localStoragedata-theme on <html>suppressHydrationWarning
The theme is applied in a useEffect, so the server sends the default and the client only corrects it after the first paint. Set data-theme from localStorage in a small blocking script in the head, and add suppressHydrationWarning to <html>.

Agent trace#

For a coding agent, write each step as one line with title, in the present while it runs (“Reading 3 of 6 files”) and in the past once done (“Read 6 files about sessions and cookies”). The live line takes full ink and a slow sweep; finished lines go muted. Give a step an icon for its kind, a search or the final check. Mark an approach that went nowhere with status="dead-end": a cross on the rail, and the line fades back. Set elapsed on the trigger and it counts “Thinking 9s”, then settles to “Thought for 14s”. Press Run again to watch the full trace.

Why does everyone get signed out after a deploy?
Searched the codebase
session.tsmiddleware.tsSignIn.tsxCookies · Next.js docs+3 more
Read 6 files about sessions and cookies
Dead end: the edge runtime can't reach the session store
Traced 9 places that sign the cookie
Ran 31 auth tests
3 tests rotate the secret
Merged the test results
Found the secret regenerated on every build
Drafted a 2-step fix
Finished thinking · 2 files to change · 2 steps
SESSION_SECRET isn't set in production, so the build generates a new one each time and every existing cookie stops verifying. Set it once in the environment and read it in session.ts instead of falling back to a random value.

Stopped runs and a custom clock#

When the user stops a run, mark the step it was on as status="stopped": a small square takes the dot's place and the title fades, so the log shows where it was cut. With your own trigger label, MessageReasoningElapsed adds the live clock: it counts from since (the time the turn was sent, so a remount doesn't restart it), stays hidden below hideBelow seconds and disappears once the run stops streaming.

Read the incident report
Matching articles of the penal code

Jump to latest#

Drop a ConversationScrollButton as the last child of a Conversation. It stays hidden while the reader is at the newest turn; scroll up and a pill fades in, centered over the thread's bottom edge (a sticky row, so it never scrolls with the history and takes no room in it). Pressing it glides back down and resumes following. The follow survives streaming and resizing: a turn that grows by itself, or a panel that changes size, keeps a reader who was at the bottom there, and the thread's own glide never flashes the pill on the way down. Stream the answer below, then scroll up while it writes.

The Conversation must be the element that scrolls: give it a height (here min-h-0 flex-1 in a sized column; in an AI Panel, <AIPanelBody scrollable={false}>).

How do I add a loading state to the data table?
Wrap the body in a Skeleton while the query is pending, and keep the header rendered so the columns don't jump when the rows land.
And an empty state?
Drop an EmptyState into the table body when the result has no rows. Give it an action that clears the filters, since that is usually why it's empty.
Can the toolbar stay pinned while the table scrolls?
Yes: the DataTableToolbar sits outside the scroll viewport, so only the rows move. Add a sticky header if you also want the column titles to stay.
What about very wide tables on a phone?

API reference#

Conversation

The scrollable thread, a role="log" polite live region; give it a height or max-height to scroll. Forwards all native <div> props. Every part accepts className, merged last.

PropTypeDefaultDescription
variant"plain" | "bubble""plain"The style of every turn: the assistant answer as a page, or every turn a bubble.
stickToBottombooleantrueFollows new turns while the reader is already at the bottom; scrolling up is never yanked back. The first pass lands instantly, later ones glide. Turn it off for a static transcript that opens at the top.
Data attributeDescription
data-variant"plain" or "bubble".

ConversationScrollButton

The "jump to latest" pill: place it as the last child of a Conversation. It shows only while the reader has scrolled away from the newest turn, floats centered over the thread's bottom edge, and on press glides back down and resumes following. The Conversation must be the element that scrolls (min-h-0 flex-1, or AIPanelBody scrollable={false}). Takes every Button prop except asChild.

PropTypeDefaultDescription
labelstring"Jump to latest"The pill's text, also its accessible name.
childrenReact.ReactNode-Replaces the default arrow and label.
variantButtonProps["variant"]"outline"Any Button variant.
size"sm" | "md" | "lg" | "xl""sm"The Button size.
Data attributeDescription
data-state"visible" or "hidden", on the sticky row that wraps the button.

Message

One turn; its role flows to every part. Forwards all native <div> props.

PropTypeDefaultDescription
role"assistant" | "user""assistant"Who sent it: drives the side, the alignment and the bubble tint.
variant"plain" | "bubble"-Overrides the style of the conversation for this turn.
Data attributeDescription
data-role"assistant" or "user".

MessageAvatar

The sender avatar, an Avatar that takes every Avatar root prop. Children replace the initials (with an icon, say).

PropTypeDefaultDescription
srcstring-The image URL.
namestring-The alt text, and the source of the initials fallback.
size"xs" | "sm" | "md" | "lg" | "xl""sm"The Avatar size.

MessageBody

The column holding header, content and actions, aligned to the message side. Forwards all native <div> props.

MessageHeader

The optional meta row above the content. Forwards all native <div> props.

MessageName

The sender name. Forwards all native <span> props.

MessageTime

The muted timestamp. Forwards all native <span> props.

MessageContent

The bubble (or, for a plain assistant turn, the page), markup-agnostic. Forwards all native <div> props.

PropTypeDefaultDescription
streamingbooleanfalseThe answer is still arriving: its text comes out at a steady pace and the freshest words settle from a lighter ink. No caret, no fade. Under reduced motion the ink is full from the start.
Data attributeDescription
data-streamingPresent while streaming.

MessageActions

The row of actions under a turn. Forwards all native <div> props.

MessageAction

One action (copy, regenerate): a Button that takes every Button prop; its aria-label names it and feeds the tooltip.

PropTypeDefaultDescription
variantButtonProps["variant"]"ghost"Any Button variant.
size"sm" | "md" | "lg" | "xl""sm"The Button size.
iconOnlybooleantrueA square icon button.

MessageBranch

Holds the versions of one answer and which is showing. Renders as display: contents, so it wraps the content and the actions row without changing the layout. Forwards all native <div> props.

PropTypeDefaultDescription
indexnumber-The active version, zero-based, controlled.
defaultIndexnumber-The first version shown, uncontrolled. Without it the newest is shown, and the branch follows each new one.
onIndexChange(index: number) => void-Called when the pager moves.
countnumber-The number of versions, when MessageBranchContent renders only the active one. Without it the count comes from the content's children.

MessageBranchContent

Renders the active version: one child per version, or just the active one with count. A switch slides the new version in toward the direction of travel; reduced motion fades only. Forwards all native <div> props.

Data attributeDescription
data-direction"next" or "prev", the last move. Absent until the first one.

MessageBranchPrevious

Shows the previous version: a MessageAction labelled "Previous version", disabled on the first. Hidden while there is one version. Takes every Button prop; children replace the caret.

MessageBranchNext

Shows the next version: a MessageAction labelled "Next version", disabled on the last. Hidden while there is one version. Takes every Button prop; children replace the caret.

MessageBranchCount

The "2/3" between the arrows, in tabular figures, with a polite live label for screen readers. Hidden while there is one version. Forwards all native <span> props; children replace the visible text.

PropTypeDefaultDescription
label(index: number, count: number) => stringVersion ${index} of ${count}The announced text, one-based. Use it to translate.

MessageFeedback

Holds the thumbs vote for one answer; wrap the actions row and the reasons with it. Renders as display: contents. Forwards all native <div> props.

PropTypeDefaultDescription
value"up" | "down" | null-The vote, controlled.
defaultValue"up" | "down" | nullnullThe vote on first render, uncontrolled.
onValueChange(value: "up" | "down" | null) => void-Called on each vote, and with null when a vote is taken back.
Data attributeDescription
data-value"up" or "down"; absent with no vote.

MessageFeedbackUp

The thumbs-up toggle: a MessageAction with aria-pressed, labelled "Good response". Picked, it fills its glyph on a faint chip; pressed again, it clears the vote. Takes every Button prop.

MessageFeedbackDown

The thumbs-down toggle, labelled "Bad response". Picking it opens MessageFeedbackReasons. Takes every Button prop.

MessageFeedbackReasons

The popover that opens from the thumbs down: reason chips, an optional comment, Cancel and Submit. Focus moves to the first reason and returns to the thumb on close. After Submit (the button spins while an async onSubmit is pending) the popover morphs into a status line, Feedback sent then the thank-you, each announced, and closes. Forwards PopoverContent props (align, side, sideOffset) except title and onSubmit.

PropTypeDefaultDescription
reasonsreadonly string[]MESSAGE_FEEDBACK_REASONSThe chips: Inaccurate, Didn't follow instructions, Too long, Unsafe, Other.
onSubmit(details: { reasons: string[]; comment: string }) => void | PromiseLike<unknown>-Called with the picked reasons and the trimmed comment. While a returned promise is pending the Submit button spins; if it rejects, the form comes back.
titleReact.ReactNode"What went wrong?"The panel's heading, also the chip group's name.
commentbooleantrueShows the optional comment field.
commentPlaceholderstring"Add details (optional)"The field's placeholder and accessible name.
submitLabelstring"Submit"The primary button. Disabled until a reason or a comment.
cancelLabelstring"Cancel"Closes the popover; the vote stays.
sentLabelReact.ReactNode"Feedback sent"Beside the success check once the feedback is in, before the thank-you.
thanksReact.ReactNode"Thanks for the feedback."The last line, rolled in from sentLabel before the popover folds away.
align"start" | "center" | "end""start"Where the popover lines up against the thumb.

MessageError

A failed reply, in place of the content: a warning glyph and the message, announced as an alert, with its children (retry, details) in a row under the text. Forwards all native <div> props.

PropTypeDefaultDescription
messageReact.ReactNode"Something went wrong while writing this reply."What happened, in a sentence.
iconReact.ReactNode-Replaces the warning glyph.

MessageErrorRetry

Sends the turn again: an outline Button that takes every Button prop.

PropTypeDefaultDescription
childrenReact.ReactNode"Try again"The label.
variantButtonProps["variant"]"outline"Any Button variant.
size"sm" | "md" | "lg" | "xl""sm"The Button size.

MessageErrorDetails

The raw error (status, request id) folded behind a ghost toggle, over Radix Collapsible.Root: forwards its props (open, defaultOpen, onOpenChange). Children render monospace, wrapping; className lands on that block.

PropTypeDefaultDescription
labelReact.ReactNode"Details"The toggle's text.
Data attributeDescription
data-state"open" or "closed", from Radix.

MessageFollowUps

A labelled list of suggested next prompts under an answer; each child becomes a list item. Forwards all native <ul> props.

PropTypeDefaultDescription
labelstring"Suggested follow-ups"The list's accessible name.

MessageFollowUp

One suggestion: a ghost Button that wraps long lines, with a reply-arrow glyph. Takes every Button prop.

PropTypeDefaultDescription
iconReact.ReactNode-Replaces the reply arrow.

MessageTyping

The line shown before the reply starts: the reasoning arc and a label, as a role="status". Children are MessageTypingNotes listed under it. Put it straight in the MessageBody. Forwards all native <div> props.

PropTypeDefaultDescription
labelstring"Thinking"The current step; a new value swaps in place.
elapsedboolean | number-true counts seconds while it is shown; a number shows that value.
indicator"arc" | "dots""arc"arc is the agent mark. dots is three pulsing dots, for a person typing in a chat between people.

MessageTypingNote

One finding under the typing line, a list item that fades and sharpens in as it arrives. Forwards all native <li> props.

MessageReasoning

The collapsible thinking block, over Radix Collapsible.Root: forwards all its props.

PropTypeDefaultDescription
streamingbooleanfalseThe model is still thinking: the mark spins and the default label reads "Thinking…".
statusAgentStatus-Overrides what the mark shows, in the shared agent vocabulary: working spins, waiting holds with a warning dot, done closes into a check, failed draws a cross, cancelled a square. Defaults to working while streaming, else done.
openboolean-Open state, controlled.
defaultOpenbooleanfalseOpen state on first render, uncontrolled.
onOpenChange(open: boolean) => void-Called when it opens or closes.
Data attributeDescription
data-state"open" or "closed", from Radix.

MessageReasoningTrigger

The one-line toggle, over Radix Collapsible.Trigger. Children are the label ("Thought for 6s"); without them it rolls between "Thinking…" and "Reasoning".

PropTypeDefaultDescription
elapsedboolean | number-true keeps its own clock: "Thinking 9s" while streaming, then "Thought for 14s". A number shows that many seconds. Ignored when you pass children.
Data attributeDescription
data-state"open" or "closed". Turns the caret.

MessageReasoningElapsed

A live seconds counter for your own trigger label ("Working… 7s"). Renders only while the reasoning streams. Forwards all native <span> props.

PropTypeDefaultDescription
sincenumber-Epoch ms the clock counts from. Defaults to when it mounted.
hideBelownumber0Stay hidden until this many seconds have passed: a short wait needs no clock.
format(seconds: number) => React.ReactNode-Renders the count, for another unit style or locale (7 s). Defaults to 7s.

MessageReasoningContent

The chain of thought behind a left rail, over Radix Collapsible.Content. className lands on the inner <div>.

Data attributeDescription
data-state"open" or "closed".

MessageReasoningStep

One phase of the reasoning log, with a node on the rail. Forwards native <div> props except title.

PropTypeDefaultDescription
titleReact.ReactNode-The one line an agent-trace step reads as. Full ink and a sweep while active, muted once done, fainter as a dead end.
labelReact.ReactNode-A quiet caption above the step ("Searching").
status"active" | "done" | "dead-end" | "stopped""done"active turns the dot into an ink pulse; dead-end swaps it for a cross and stopped (the user cut the run there) for a small square, both fading the title.
markerbooleantrueDraws the rail node (the dot, or the icon).
iconReact.ReactNode-A glyph in place of the dot (14px unless it carries its own size-*), such as a search or the final check.
Data attributeDescription
data-status"active", "done", "dead-end" or "stopped".

MessageReasoningFiles

A wrapping row of file pills. Forwards all native <div> props.

MessageReasoningFile

One file or page the model opened: a pill, not a link. Forwards all native <span> props.

PropTypeDefaultDescription
name*string-The file name; its extension picks the glyph (ts, tsx, css, md…). Children replace it as the label.
iconReact.ReactNode-Overrides the derived glyph.

MessageReasoningFilesMore

The "+3 more" that closes a row of files. Forwards all native <span> props.

MessageReasoningQueries

A wrapping row of query pills. Forwards all native <div> props.

MessageReasoningQuery

One search the model ran: a monospace pill with a magnifier. Forwards all native <span> props.

MessageReasoningSources

The URLs the model consulted. Forwards all native <div> props.

PropTypeDefaultDescription
layout"chips" | "list""chips"Compact domain pills, or a bordered list of titled rows. Flows to each source.
Data attributeDescription
data-layout"chips" or "list".

MessageReasoningSource

One source, an <a> that opens in a new tab. Forwards native <a> props except title.

PropTypeDefaultDescription
href*string-The URL; the domain and favicon derive from it.
titleReact.ReactNode-The headline in the list layout; the domain by default.
faviconstring-Overrides the derived favicon; a globe shows if it fails.

FAQ#

role is the only switch: assistant aligns left with an avatar and a muted bubble, while user aligns right in a bubble: a soft ink fill in the default plain (assistant) thread, the solid sent colour in the messenger bubble variant. The value flows to every part through context, and both bubbles use a soft, uniform radius on all four corners.