suiss/ui · AI
Chat
A conversation thread where each turn holds a message, the agent's steps and its reply, inside a Message Scroller.
Chat is the thread of a conversation with an agent. Each turn is a Message inside a Message Scroller. The steps the agent took sit above its reply as Trace rows, and the field at the bottom is a Prompt Input.
The person's message is the scroll anchor, so a new question settles near the top and the reply streams in under it.
Installation
Chat is built with Message Scroller, Message, Bubble, Trace, Code Block, Input Group, Dropdown Menu and Tooltip.
Or use the suiss/ui CLI:
Usage
Set scrollAnchor on the person's turn. autoScroll follows the reply while the person stays at the live edge, and MessageScrollerButton jumps back down when they scroll away.
AI SDK
Render each message from useChat. The person's turn is a bubble. The agent's turn maps its reasoning and tool parts to Trace rows, then shows the text.
Set aria-busy on MessageScrollerContent while status is submitted or streaming.
API Reference
See Message Scroller, Message, Trace and Input Group.
Accessibility
- Give the textarea an accessible name such as "Message", since the placeholder is not a label.
- Give icon-only buttons, such as reset, add context and send, an
aria-label. - Enter sends the message and Shift+Enter adds a new line.
Chat on mobile is built from the same parts as on the web: Message, Bubble, Trace, Code Block, Input Group. The example above is a static demo; connect it to your agent by rendering the same parts from your messages.
Installation
API Reference
See Message, Bubble, Trace, Code Block, Input Group.