PromptInput
Multiline AI prompt textarea with submit and keyboard shortcuts.
Installation
dotnet add package Lumeo
One-time app setup (AddLumeo(), CSS & JS) is covered in the
installation guide.
Usage
@using Lumeo <PromptInput />
Tested
Tier 3 · A11y + behavior
all components → Render Behavior A11y Keyboard Scale E2E
27 tests across 1 file. Auto-generated from the test suite.
When to Use
- Build chat interfaces, AI assistant prompts, or command inputs.
- Use Enter to submit and Shift+Enter for newlines — built in.
- Add leading or trailing content slots for model selectors, voice input, and file attachments.
0/200
Shift+Enter for newline
Keyboard Interactions
| Key | Action |
|---|---|
| Enter | Submits the prompt (fires OnSend). |
| Shift + Enter | Inserts a newline without submitting. |
API Reference
PromptInput
| Prop | Type | Default | Description |
|---|---|---|---|
| Value | string? | — | The textarea's text content. |
| Placeholder | string | "Ask anything…" | Placeholder text shown when the textarea is empty. Default: "Ask anything…". |
| MaxHeight | int | 240 | Maximum height in px the textarea autosizes to before scrolling. Default: 240. |
| MinHeight | int | 56 | Minimum height in px the textarea autosizes down to. Default: 56. |
| IsLoading | bool | false | Disables the textarea and swaps the send button for a spinner (or the Stop button when OnStop is bound), indicating a response is in flight. |
| DisableSendOnEmpty | bool | true | Disables the Send button while Value is empty/whitespace. Default: true. |
| Attachments | RenderFragment? | — | Optional slot for attachment chips/thumbnails, rendered above the textarea. |
| ShowAttachButton | bool | false | Shows a built-in paperclip attach button in the leading area that invokes OnAttach. |
| MaxLength | int? | — | Hard character limit. When set, the textarea enforces maxlength and a "count/limit" counter is shown. The counter turns into a destructive color as the limit is approached. |
| ShowCounter | bool | false | Forces the character counter to render even when MaxLength is not set (shows the raw count). |
| LeadingContent | RenderFragment? | — | Extra content rendered in the footer's leading area, alongside the attach button. |
| TrailingContent | RenderFragment? | — | Extra content rendered in the footer's trailing area, before the Send/Stop button. |
| Class | string? | — | Additional CSS classes merged onto the root wrapper. |
| AdditionalAttributes | Dictionary<string, object>? | — | Additional HTML attributes captured and forwarded to the root wrapper. |
Events
| ValueChanged | EventCallback<string?> | Invoked on every keystroke with the updated text. |
| OnSend | EventCallback<string> | Invoked with the current text when the user sends (Send button click, or Enter without Shift/Ctrl/Alt/Meta). |
| OnStop | EventCallback | Invoked when the user clicks the Stop button. The Stop button only replaces Send while IsLoading is true AND this callback is bound — so a consumer that doesn't support cancellation keeps the previous disabled-spinner behaviour unchanged. |
| OnAttach | EventCallback | Invoked when the built-in attach button is clicked (only when ShowAttachButton is true). |
Related Components
- StreamingText — Token-by-token streaming text renderer for AI responses.
- Textarea — Plain multiline text input without the AI-chat chrome.