interfaces for intelligence
streaming-first components for chat, agents and tool use
open source and shadcn-compatible. copy the code into your project and own every line.
works with the vercel ai sdk, langchain, openai, anthropic, next.js, tailwind and base ui
every reply streams smoothly
markdown is split into blocks, so only the live block re-renders
reasoning, tool calls and citations
collapsible thinking, live tool status and numbered sources with previews, all keyboard reachable.
plans and traces
show what an agent is doing as it happens, then how long each step took.
humans stay in control
approvals, artifacts and feedback are first-class
approvals
a named dialog that keeps focus where the decision was made.
artifacts
a side pane with preview and code tabs for generated work.
feedback
thumbs with an optional follow-up, returning focus afterwards.
an input that does it all
files, slash commands and a model picker, in one composer
slash commands and attachments
drop, paste or attach files, and type / to run a command or insert a template.
one api, any backend
plain props and no provider. wire it to the vercel ai sdk, langchain or raw server-sent events.
your code, not a dependency
install with the shadcn cli and edit every line. components stay self-contained.
accessible by default
tested with axe and by keyboard, in every state
keyboard first
every control is reachable and operable without a mouse, and focus is never dropped.
screen reader aware
live regions wait for a reply to finish, and state is spoken, not just colored.
clear contrast
text meets the 4.5:1 minimum on every surface.
reduced motion
movement stops when your system asks for less.
copy it into your project
no package to install and nothing to fork
add a component
pull the source in with the shadcn cli. dependencies resolve automatically.
compose
wire it to your data with plain props. no wrappers and no context.
make it yours
it is your file now. change the markup, tokens and behavior freely.
npx shadcn@latest add https://turnui.xyz/r/prompt-composer.jsonall 21 components
- 01ButtonAccessible button on Base UI with four variants and three sizes.foundation
- 02MessageChat message layout with user and assistant roles and hover actions.conversation
- 03Streaming MarkdownMarkdown renderer for token streams. Finished blocks are memoized so only the active block re-renders.conversation
- 04Code BlockSyntax-highlighted code with light and dark themes and a copy button.conversation
- 05CitationsInline numbered markers with hover previews, plus a sources footer.conversation
- 06Prompt ComposerAuto-growing input. Enter sends, Shift+Enter adds a line, and send becomes stop while streaming.input
- 07FeedbackThumbs up and down for a response, with an optional follow-up for reasons and a comment. Designed to sit in the message actions row.conversation
- 08Slash CommandsType "/" in the Prompt Composer to open a filterable command menu. Arrow keys navigate, Enter or Tab selects, Escape dismisses.input
- 09Model PickerSearchable model selector grouped by provider, with context size and capability tags. Sits in the Prompt Composer toolbar.input
- 10AttachmentFile chips and image thumbnails with upload progress and errors, plus a hook that handles validation, previews and uploads. Plugs into Prompt Composer for drag-and-drop, paste and attach.input
- 11ReasoningCollapsible thinking block that opens while streaming and collapses when done.agent
- 12Tool CallCollapsible card showing a tool's status, input, output and error.agent
- 13PlanStep list with done, active, pending and error states.agent
- 14TraceWaterfall view of an agent run, one row per span.agent
- 15Approval PromptHuman-in-the-loop gate where the agent asks for a yes or no.agent
- 16ArtifactSide pane for generated content with Preview and Code tabs.agent
- 17Scroll to BottomA jump-to-latest button that appears when a scroll container is not at the bottom. Pairs with useAutoScroll.conversation
- 18ThinkingA loading indicator for the gap between sending a message and the first token.conversation
- 19Error NoticeA failed reply with a plain explanation and an optional retry.conversation
- 20Copy ButtonCopies text and confirms it. Sits in the message actions row next to Feedback.conversation
- 21SuggestionsA row of starter prompts. One scrolling line on phones, wrapped on wider screens.input