Text AreaPro
The multi-line twin of the text field: grows with the text, a character count, a button for more room and ⌘ Enter to send.
oxyn add text-areaThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- The multi-line twin of the text field.
- It grows with its text from min_rows (3) to max_rows (10) on a 180 ms height tween, then scrolls inside; a counter shows “120/2,000” (red, and the field invalid, when a prefilled value is already over the limit); an optional corner button gives the field expanded_rows (16) of room and back; ⌘/Ctrl+Enter submits while Enter alone makes a new line.
- The label focuses the field; the error replaces the hint with a red edge and a faint red fill.
When not to use
- On or off for things that apply right away: use Switch instead.
- A real checkbox with a label and second line, an indeterminate state for Select all, an error, a card row and a check that draws itself: use Checkbox instead.
- Pick one: use Radio group instead.
Installation
Text Area is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add text-areaUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Default
Grows with the text; counter and more-room button.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Error
The error takes the hint's place; red edge and faint fill.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Over
A prefilled value over the limit turns the counter red.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Prompt
Monospace for prompts, optional, empty.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
TextArea
| Prop | Type | Default | Description |
|---|---|---|---|
label | Option<String> | Default::default() | Label above the field; clicking it focuses the field. |
value | String | Default::default() | Initial text. |
placeholder | Option<String> | Default::default() | Placeholder. |
hint | Option<String> | Default::default() | Quiet line under the field. |
error | Option<String> | Default::default() | Error: red edge, faint red fill, aria-invalid; shown where the hint was. |
optional | bool | Default::default() | "Optional" next to the label. |
counter_on | bool | Default::default() | Show the counter (needs `max_length`). |
max_length | Option<usize> | Default::default() | Character limit. |
min_rows | usize | 3 | Lines when empty. |
max_rows | usize | 10 | Lines before it scrolls inside. |
expandable | bool | Default::default() | The more-room button. |
expanded_rows | usize | 16 | Lines while expanded. |
mono | bool | Default::default() | Monospace text (prompts). |
disabled | bool | Default::default() | Disabled. |
on_input | EventHandler<String> | — | Every edit. |
on_submit | EventHandler<String> | — | ⌘/Ctrl+Enter. |
on_expanded | EventHandler<bool> | — | Expanded or not. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| ⌘/CtrlEnter | Submits (save or send) |
| Enter | New line |
| Tab | Moves to the more-room button |
Accessibility
- The label is a <label for>: clicking it focuses the field.
- aria-invalid and aria-describedby point at the hint or error row.
- The more-room button has aria-expanded and aria-controls.
From the spec
- <label for> focuses the field.
- aria-invalid; aria-describedby → the hint or error row.
- More-room button: aria-expanded, aria-controls.
Motion & interaction
Timing
- Reduced motion: rows open at full height, words and digits swap without rise or roll, the ghost appears and turns solid without fading, the height tween is off.
Responsive behaviour
- Fills its container; the height follows the text up to ten lines, then scrolls.
Edge cases (spec)
- Fills its container.
Notes for AI
- Import
TextAreafromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - There is no GPUI version yet; use the Dioxus component.
- Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.