Inputs
TextArea
Multi-line text input with label, glass styling and configurable resize behavior.
<script>
import { TextArea } from "@codeatlasdev/ui";
let message = $state("");
</script>
<TextArea label="Message" bind:value={message} rows={4} />
The label floats when the field has a value or a placeholder. description is hidden while an error is shown. Text stays at 16px or more on touch devices so iOS Safari does not zoom on focus.
Basic
Empty, with a placeholder, and pre-filled.
Code
States
Helper text, error, required, read-only, disabled and resize="none".
Max 500 characters.
Bio must be at least 20 characters.
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | '' | Bindable text value. |
label | string | – | Label text. |
placeholder | string | '' | Native placeholder. Also floats the label. |
rows | number | 4 | Initial visible row count. |
minRows | number | – | Minimum rows for the min-height. Defaults to rows. |
resize | 'none' | 'vertical' | 'horizontal' | 'both' | 'vertical' | CSS resize behavior. |
error | string | – | Error message. Sets the error styling. |
description | string | – | Helper text shown below. Hidden when error is set. |
helperText | string | – | Deprecated alias of description. |
disabled | boolean | false | Disables the textarea. |
required | boolean | false | Marks the field as required, with a visual asterisk. |
readonly | boolean | false | Makes the textarea read-only. |
name | string | – | Native name, for form submission. |
class | string | – | Extra classes on the root. |
oninput | (value: string) => void | – | Called on every keystroke with the new value. |
onchange | (value: string) => void | – | Called when the value is committed (blur). |
onblur | (e: FocusEvent) => void | – | Called when the textarea loses focus. |