HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Composer

PreviousNext

The message box for an AI chat, with a model picker, voice dictation, send, and room around it for a heading, credits or usage.

Base UIReact AriaRadix UI
Can you summarise this week's invoices?
Six invoices went out this week for $14,250. Two are paid and four are due by Friday.
Invoices assistant
1,240 of 2,000 credits left
Enter to send, Shift Enter for a new line

Installation#

pnpm dlx shadcn@latest add https://anotherui.dev/r/composer.json

Usage#

import {
  Composer,
  ComposerFooter,
  ComposerHeader,
  ComposerUsage,
} from "@/components/ui/composer"
<ComposerHeader>
  New chat
  <ComposerUsage used={1640} total={2000} className="ml-auto" />
</ComposerHeader>
<Composer
  models={[
    { id: "opus", label: "Opus 5.5", description: "Most capable" },
    { id: "sonnet", label: "Sonnet 5.5", description: "Fast and smart" },
  ]}
  onSubmit={(text, model) => send(text, model)}
  busy={streaming}
  onStop={stop}
/>

Parts#

  • Composer. A textarea that grows with its text up to maxRows. The model picker leads the bottom row, and dictation and send trail it. Enter sends and Shift Enter adds a line. While busy, send turns into stop.
  • Model picker. Pass models with a label, and optionally a description, an icon and a badge. Leave it out to hide the picker.
  • Dictation. Uses the browser's speech recognition and writes into the box as you speak. Where the browser has none, the button is disabled and its tooltip says so.
  • ComposerHeader. A row above for a heading, chips, or usage aligned to the right.
  • ComposerFooter. A row below for usage, credits or hints.
  • ComposerUsage. A meter with the amount left. It turns red when what is left drops under warnAt, 10% by default.
CommandContext Menu

On This Page

InstallationUsageParts