Skip to content
Back

AI composerPro

The prompt box of an AI app: / commands and @ mentions as atomic tokens, a model and effort menu, a ring counter near the limit, and a send button that turns into a stop control ringed by the reply's progress.

oxyn add ai-composer

What should we work on?

The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • The prompt box of an AI app. / at a line start opens commands (/summarize, /translate, /explain, /fix); @ after a space or at the start opens files and docs (trigger, filter).
  • Arrow keys move through the open list while the field keeps focus; Enter or Tab inserts the choice as one atomic token, and Backspace on an empty field removes the last token whole (text before it becomes editable again).
  • Starters under the composer fill it (a known command at the start becomes a token).
  • The toolbar holds the model chip with an effort control and a Web search toggle.

When not to use

  • Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
  • The model menu of an AI chat: use Model Picker instead.
  • The prompt box for an agent, in six layouts: use Composer instead.

Installation

AI composer is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add ai-composer

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Default

Type / or @; send to see the stop ring.

What should we work on?

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Limit

A low limit shows the ring counter.

What should we work on?

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Bare

No suggestions.

What should we work on?

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

AiComposer

PropTypeDefaultDescription
greetingString"What should we work on?"Heading of the new chat state.
suggestionsVec<(String, String)>Default::default()Starters under the composer: label and prompt.
modelsVec<(String, String, String)>Default::default()Models: id, short name, note.
mentionsVec<String>Default::default()Files and docs for `@`.
placeholderString"Ask anything, / for commands, @ to add context"Placeholder.
max_lengthusize4000Character limit.
textStringDefault::default()Starting text.
replyString"Here's a plan: add a token bucket per API key in the gateway, return 429 with Retry-After when it empties, and cover it with two integration tests. I'll start with the middleware."The reply the demo streams back.
nowrequiredClockMs—Shared clock (streaming).
on_sendEventHandler<(String, String)>—Sent: plain text with tokens written as /cmd and @name, and the model id.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterSend, or insert the highlighted option
ShiftEnterNew line
/Commands at a line start
@Files and docs
↑or↓Move through the open list
TabInsert the option
EscapeClose the list
BackspaceRemove a token whole

Accessibility

  • The field controls the list through aria-activedescendant.
  • Send flips its label to Stop while streaming.
From the spec
  • The field references the list with aria-activedescendant; Send becomes Stop while streaming.

Motion & interaction

Timing
  • Arrow lift and stop pop 220 ms; reply chunks every 34 ms; ring 200 ms.
  • Reduced motion stops the shimmer and caret blink.

Responsive behaviour

  • Fills its container up to 560 px.
Edge cases (spec)
  • Up to 560 px.

Notes for AI

  • Import AiComposer from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: AiComposerEl in oxyn_gpui.
  • Props to set first: now.
  • It reads a clock (now) for live timers; pass one clock for the whole page rather than one per component.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI