Docs

React UI

Examples

Recipe-style examples for building @anvia/react-ui surfaces.

These examples show complete composition patterns rather than isolated primitives. Use them as starting points for app-owned chat, completion, tool-call, and review experiences.

Recipes

Minimal message row

Use this when Thread.Messages has a child function and the app owns each row.

import { Message } from "@anvia/react-ui";

export function ChatMessage() {
  return (
    <Message.Root className="message">
      <Message.Content className="message-content">
        <Message.Parts />
      </Message.Content>
      <Message.Actions className="message-actions">
        <Message.Copy>Copy</Message.Copy>
        <Message.Regenerate>Try again</Message.Regenerate>
      </Message.Actions>
    </Message.Root>
  );
}

Minimal composer

Use this as the base for a product composer. Add attachment controls and custom buttons as needed.

import { Composer } from "@anvia/react-ui";

export function ChatComposer() {
  return (
    <Composer.Root className="composer">
      <Composer.Attachments className="attachments" />
      <Composer.AddAttachment>Attach</Composer.AddAttachment>
      <Composer.Input maxRows={6} placeholder="Send a message..." />
      <Composer.Stop>Stop</Composer.Stop>
      <Composer.Submit>Send</Composer.Submit>
    </Composer.Root>
  );
}