Skip to content

Prompt Box

Standalone assistant composer with auto-resizing textarea, attachments row, model pill, slash-command hints, and send/stop states.

parser.ts4.2 KB
gpt-4.1Enter to send · Shift+Enter newline

Installation

bash
npx @galaxy-stack/nebula-cli@latest add prompt-box

Usage

tsx
import { PromptBox } from '@/components/assistant/prompt-box';

<PromptBox
  model="gpt-4.1"
  commands={[
    { name: 'fix', description: 'Fix the selected problem' },
    { name: 'explain', description: 'Explain the selected code' },
  ]}
  onSubmit={(content) => send(content)}
/>

Features

  • Auto-resize — textarea grows with content (max 160px)
  • Slash commands — type / for live command hints
  • Attachments — file chips with size labels
  • Model pill — active model display
  • Send/Stop states — destructive Stop while streaming

API Reference

PromptBoxProps

PropTypeDefaultDescription
placeholderstring'Type a message…'Input placeholder
modelstring?Model pill label
attachmentsPromptAttachment[][]Attachment chips
commandsSlashCommand[]?[]Slash command hints
busybooleanfalseShow Stop state
onSubmit(content: string) => voidSubmit handler
onStop() => voidStop handler

Released under the MIT License.