Components for AI chat and agent apps

Prompt input, streamed answers, tool calls, approvals, a model picker, a context meter, response branches and a voice orb: React parts for chat and coding-agent interfaces.

They are built for runs that stream, take a while and may be stopped halfway: output grows without throwing the reader around, finished steps fold away, and a person can approve or reject before a tool runs. Each one comes with a live demo, an @karaui install command and its source.

Conversation

The composer, the messages and the controls under each reply: type a prompt or start from a suggestion, lay out each turn, copy or rate an answer, and step between regenerated versions.

Prompt Input

The text box where people talk to your agent: it grows with the draft up to a row limit, sends on Enter with Shift+Enter for a new line, offers a model picker and a prompt action menu, and swaps send for stop during a reply.

Prompt Suggestions

Suggested prompt cards or chips (`PromptSuggestions`) that stagger in on first reveal, filter and highlight as the composer text changes via `query`, reflow with spring layout, move with arrow keys and hand the chosen prompt to `onSelect` — built for empty-chat welcome screens above a PromptInput.

Message

Building blocks for one chat transcript row: Message, MessageGroup, MessageAvatar, header, content and footer slots, a live marker and a typing indicator. A freshly sent row can pop up once from its trailing corner.

Message Bubble

The visible surface of a single chat message: six tones from solid to danger, start or end alignment inherited from its Message row, tight bubble groups, a line-clamped show-more toggle, and room for links or buttons inside.

Message Actions

Assistant message action row (`MessageActions`) with copy that morphs into a drawn check, regenerate that spins (continuously while its promise runs), exclusive thumbs up/down that pop in filled, a thumbs-down reason popover with toggle chips and comment, share and a more menu; reveals on message hover or focus and stays visible on touch or with `visibility="always"` for the last message — a standalone, richer counterpart to StreamingResponse's built-in actions.

Branch Navigator

Version switcher for regenerated or edited messages: `Branches` shares a controlled or uncontrolled index, `BranchContent` cross-fades and slides the active version in from the direction you navigated, and `BranchNavigator` renders a "‹ 2 / 3 ›" control with a rolling counter, arrow/Home/End keys and live announcements, usable standalone too.

Message Scroller

A scroll container for chat transcripts that stays pinned to the newest streamed text only while the reader sits near the bottom, stops following once they scroll up, and can add a rail for jumping between messages.

Answers and sources

Show a reply while it is still being written, generate an image in place, and link each claim to the page it came from.

Progress and plans

Let people know the agent is busy, show the task list it is working through, and keep a readable log of what it did, with no made-up percentages.

Tool output and code

Display command output, generated code and file diffs as they stream, with copy buttons, and fold output and diffs away once a step finishes.

Approvals

Stop before a risky tool call or put a question to the user, then keep their answer visible in the run history.

Model and context

Let users choose which model handles the run and see how much of its context window is already used, with an optional compact action.

Voice

Record speech and turn it into a prompt, or show an animated orb that reacts to listening, thinking and speaking.

Workspace and history

The frame around a chat: a sidebar for projects and files, a searchable list of past conversations, a side panel for generated artifacts, and a full chat app that puts them together.