Skip to content
Back

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-area
⌘ Enter saves. The agent reads this before every run.
66/200
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

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.

Terminal
oxyn add text-area

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Default

Grows with the text; counter and more-room button.

⌘ Enter saves. The agent reads this before every run.
66/200
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Error

The error takes the hint's place; red edge and faint fill.

Add at least one instruction for the agent.
66/200
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Over

A prefilled value over the limit turns the counter red.

⌘ Enter saves. The agent reads this before every run.
212/200
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Prompt

Monospace for prompts, optional, empty.

⌘ Enter saves. The agent reads this before every run.
0/200
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

TextArea

PropTypeDefaultDescription
labelOption<String>Default::default()Label above the field; clicking it focuses the field.
valueStringDefault::default()Initial text.
placeholderOption<String>Default::default()Placeholder.
hintOption<String>Default::default()Quiet line under the field.
errorOption<String>Default::default()Error: red edge, faint red fill, aria-invalid; shown where the hint was.
optionalboolDefault::default()"Optional" next to the label.
counter_onboolDefault::default()Show the counter (needs `max_length`).
max_lengthOption<usize>Default::default()Character limit.
min_rowsusize3Lines when empty.
max_rowsusize10Lines before it scrolls inside.
expandableboolDefault::default()The more-room button.
expanded_rowsusize16Lines while expanded.
monoboolDefault::default()Monospace text (prompts).
disabledboolDefault::default()Disabled.
on_inputEventHandler<String>—Every edit.
on_submitEventHandler<String>—⌘/Ctrl+Enter.
on_expandedEventHandler<bool>—Expanded or not.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
⌘/CtrlEnterSubmits (save or send)
EnterNew line
TabMoves 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 TextArea from oxyn_dioxus and include STATUS_INDICATOR_CSS plus 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.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI