Components
Prompt Input
An AI chat composer with an auto-growing textarea, attach and send buttons, and ⌘↵ to send.
php artisan blatui:add prompt-input
<div class="w-full max-w-xl">
<x-ui.prompt-input aria-label="Message" placeholder="Send a message…" />
</div>
Disabled
<div class="w-full max-w-xl">
<x-ui.prompt-input :disabled="true" :attachable="true" placeholder="Composer is disabled" />
</div>
With Attachment
<div class="w-full max-w-xl">
<x-ui.prompt-input :attachable="true" placeholder="Ask anything…" />
</div>
API Reference
Props, slots and exposed methods for
<x-ui.prompt-input>.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder |
string
|
'Send a message…'
|
Placeholder text shown in the empty textarea. |
name |
string
|
— | The name attribute for the textarea, so its value is submitted when the component is inside a <form>. |
id |
string
|
— | The id attribute for the textarea, e.g. to pair it with an external <label>. |
attachable |
bool
|
false
|
Show an "Attach file" paperclip button in the toolbar. The button is presentational; wire your own upload handling to it. |
disabled |
bool
|
false
|
Disable the textarea and toolbar buttons and block submit(). |
rows |
int
|
1
|
Initial visible row count of the textarea before it auto-grows with content. |
maxRows |
int
|
6
|
Maximum rows the textarea grows to before it starts scrolling internally. |
Slots
| Slot | Description |
|---|---|
default |
Not used for content — the component renders its own auto-resizing textarea and toolbar. Pass aria-label as an attribute to name the textarea (defaults to "Message"). Inside a <form>, ⌘/Ctrl+Enter or the send button submits the form; otherwise it dispatches a bubbling "submit" event with detail.value carrying the trimmed text. |
Methods
Available on the component's Alpine scope — call them from markup in the slot
(e.g. @click="…").
| Method | Description |
|---|---|
submit() |
Submits the prompt: requests the enclosing form's submit, or dispatches a bubbling "submit" CustomEvent with the trimmed value. No-op while disabled or empty. |