Agent skill UI design
Primitives
Shape a web interface around a coherent visual direction.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add https://github.com/assistant-ui/skills/tree/main/assistant-ui/skills/primitives --skill primitives --agent claude-code --yesCheck this file in your project.claude/skills/primitives/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add https://github.com/assistant-ui/skills/tree/main/assistant-ui/skills/primitives --skill primitivesSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. A working AssistantRuntimeProvider, the target thread, a local adapter with streamable responses, and the intended send/cancel interaction.
View operation manualWhat this skill helps with
- Shape a web interface around a coherent visual direction.
Good for
- Visual direction
- Task
- Build an accessible custom composer without duplicating runtime state
- Inputs
- A working AssistantRuntimeProvider, the target thread, a local adapter with streamable responses, and the intended send/cancel interaction.
- Outcome
- A project-styled composer that can send with keyboard, expose a real Stop action during a run, and return to editing afterward.
- Skill name
primitives- Repository
assistant-ui/skills
Choose where chat state is managed
An underspecified approach
Replace the chat input with an animated icon bar and manage loading state myself.
Duplicated loading state can disagree with the runtime, and an icon-only button can become difficult to identify by keyboard or a screen reader.
A verifiable workflow
- Find the real thread and confirm the target input, send and cancel contracts.
- The composer displays Send while idle and Stop during a live run.
- Both actions are reachable, cancellation restores the ready UI, and another message can be sent.
assistant-ui Primitives operation manual
A project-styled composer that can send with keyboard, expose a real Stop action during a run, and return to editing afterward.
A working AssistantRuntimeProvider, the target thread, a local adapter with streamable responses, and the intended send/cancel interaction.
Check the provider and native primitive behavior
Find the real thread and confirm the target input, send and cancel contracts.
Prompt · Step 1Use the assistant-ui primitives Skill from assistant-ui/skills on [thread route and scoped composer]. Check that AssistantRuntimeProvider is above the thread and that the installed @assistant-ui/react supports AuiIf, ComposerPrimitive and ThreadPrimitive. Confirm ordinary Enter and newline behavior from the current input configuration. Identify accessible names for input, Send and Stop.Compose the input and derive state from the runtime
The composer displays Send while idle and Stop during a live run.
Prompt · Step 2Build [custom composer] from ComposerPrimitive.Root, .Input, .Send and .Cancel. Use AuiIf with s.thread.isRunning to swap the action. Preserve the native input and button behavior. Only add asChild where the resulting element forwards props and refs correctly. Keep styling in the project and reuse ThreadPrimitive with MessagePrimitive.Parts for its actual messages.Operate the same UI by keyboard during a real test run
Both actions are reachable, cancellation restores the ready UI, and another message can be sent.
Prompt · Step 3In [test thread with a deterministic delayed response], verify initial input and Send, send a nonempty message with the intended key behavior, and check that Stop is reachable and named while running. Cancel and verify Send returns. Check focus, absent empty submissions, mobile width, and sending again. Record readback of the adapter abort if available.
Look up the runtime and primitives
Match the official reference to your installed version.
My primitives render but cannot send. What should I check?@assistant-ui/react
- Command or reference
ThreadPrimitive · ComposerPrimitive · AuiIf- Examples
- Make sure the composer is inside the runtime provider for the active thread and the installed primitives receive the intended input. Check that custom asChild children preserve native form elements, refs and event props.
Troubleshooting and FAQ
My primitives render but cannot send. What should I check?
Make sure the composer is inside the runtime provider for the active thread and the installed primitives receive the intended input. Check that custom asChild children preserve native form elements, refs and event props.