Component · Input

PromptInputTextarea

Auto-expanding textarea. Inherits state and disabled from its PromptInput parent via DI. Uses field-sizing: content with a JS fallback for older browsers.

Basic usage

html
<prompt-input>
  <prompt-input-textarea
    placeholder="Ask anything…"
    [maxHeightPx]="240"
    [maxLength]="4000"
  />
</prompt-input>

API — Inputs

NameTypeDefaultDescription
placeholderstring'Ask anything…'Native placeholder text.
rowsnumber1Initial row count.
maxLengthnumber | nullnullHard cap on character count.
maxHeightPxnumber192Maximum height before scroll. 12rem default.
ariaLabelstring'Prompt'aria-label for the textarea.

API — Methods

NameTypeDescription
focus()() => voidFocus the textarea programmatically.
blur()() => voidBlur the textarea.

Accessibility

  • Renders a native <textarea> with aria-multiline="true"
  • aria-disabled mirrors parent's disabled
  • data-state attribute exposes parent state
  • Automatically disables while parent is in submitted state
MIT © Kalvnerv0.1.0 · pre-release