Comma Agents
@comma-agents/tuiComponents

ChatTextArea

Strategy-aware prompt input combining TextAreaInput with strategy cycling.

ChatTextArea

Wraps TextAreaInput with strategy selection. The user cycles through available strategies with Tab and submits a message with Meta+Enter. On submit, the selected strategy value and input text are passed to the onSubmit callback.

import { ChatTextArea } from "@comma-agents/tui";

<ChatTextArea
  strategies={[
    { label: "Plan", value: "plan", description: "Think step-by-step" },
    { label: "Build", value: "build", description: "Write code directly" },
  ]}
  onSubmit={(strategyPath, input) => {
    startStrategy(strategyPath, input);
  }}
/>

ChatTextAreaProps

PropTypeDefaultDescription
strategiesreadonly StrategyOption[]--Available strategies to cycle through
onSubmit(strategyPath: string, input: string) => void--Called with the selected strategy value and input text
focusbooleantrueWhether the input is focused
widthnumber | string"100%"Width of the text area
heightnumber10Visible row count
placeholderstring"Enter your prompt..."Placeholder text
idstring--Ink focus ID for programmatic focusing

StrategyOption

FieldTypeDescription
labelstringShort display name (e.g. "Plan")
valuestringStrategy identifier passed to onSubmit
descriptionstringOne-line description shown alongside the label

The render function displays the TextAreaInput above a strategy row that shows the active strategy label, its description, and keyboard hints (tab strategy · meta+enter send).

Keyboard Shortcuts

KeyAction
TabCycle to the next strategy
Meta+EnterSubmit the current input with the selected strategy

On this page