Component · Action

PromptInputSubmit

The submit button. Renders 4 distinct icons and color treatments based on the parent's state. Clicking calls parent.submit() which delegates to submitted / canceled / retried per state.

Basic usage

html
<prompt-input>
  <prompt-input-textarea />
  <prompt-input-toolbar>
    <prompt-input-submit />
  </prompt-input-toolbar>
</prompt-input>

Visual states

NameTypeDescription
readystatePrimary background, arrow icon. Click submits.
submittedstateMuted background, spinning ring. Click is no-op (button disabled).
streamingstateDestructive/10 background, stop square icon. Click cancels.
errorstateDestructive background, alert icon. Click retries.

API — Inputs

NameTypeDefaultDescription
disabledbooleanfalseDisable independently of parent.

Accessibility

  • aria-label updates per state: "Send message" / "Submitting" / "Stop generating" / "Retry"
  • aria-busy="true" during submitted and streaming
  • data-state attribute exposes current state for CSS targeting
  • Disabled when parent is disabled OR when value is empty in ready state
  • Focus ring respects --ring token
MIT © Kalvnerv0.1.0 · pre-release