Textarea
atomsMulti-line text input with autoresize, a themed drag handle on either edge, a max height and keyboard submit.
Review comment
autoresize grows with the text up to maxHeight; submitOn="mod-enter" posts, Shift+Enter still breaks lines.
Sizes, mono and rows
size sm/md/lg sets the type scale, rows the initial height, mono the family; block fills the width.
States
disabled, readonly, invalid via Field error, and long content capped by maxHeight so it scrolls instead of growing.
Resize handles
resize="bottom" (default) or "top" draws a drag grip; with autoresize the grip sets a floor the text still grows past; "none" removes it.
Masked spans
segments splits the value for a mirror overlay behind the textarea; mask hides a span while typing, caret and selection stay native.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
mono | boolean | false | |
autoresize | boolean | false | |
size | ControlSize | — | |
grow | boolean | false | Fill the free space of a flex row (`flex: 1 1 0`). |
shrink | boolean | true | `false` pins the box (`flex: none`). |
block | boolean | false | Full-width block. |
resize | 'none' | 'top' | 'bottom' | 'bottom' | Manual resize handle edge, or 'none' to disable. Defaults to a bottom handle. With `autoresize` it drags a min-height floor (the textarea still grows with content). |
invalid | boolean | false | Error state: danger border + aria-invalid (also styles if a consumer sets aria-invalid directly). |
maxHeight | string | — | Cap the height (with autoresize: stop growing and scroll past this). |
onsubmit | (value: string) => void | — | Fires with the current value on the `submitOn` key combo. |
submitOn | 'enter' | 'mod-enter' | 'none' | 'none' | |
segments | (value: string) => TextareaSegment[] | — | Split the value into spans for the mirror overlay; the texts must concatenate back to the value so glyphs line up 1:1. `mask` keeps a span's layout but hides its glyphs under a fill; `class` is added to the span. Unset: no overlay, no extra DOM. |
id | string | — | |
aria-describedby | string | null | — | |
aria-invalid | HTMLTextareaAttributes['aria-invalid'] | — | |
class | string | '' | |
value bindable | HTMLTextareaAttributes['value'] | — | |
el bindable | HTMLTextAreaElement | null | null |