Textarea API
import { Textarea } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
autofocus | boolean | |
autosize | boolean | |
children | React.ReactNode | |
clearable | boolean | |
color | string | |
counter | boolean | Same as showCount, named like Input's prop. |
debounce | number | |
defaultValue | string | Starting value of an uncontrolled field (written once, on mount). |
density | 'compact' | 'default' | 'comfortable' | |
description | string | |
descriptionPosition | 'above' | 'below' | Put the description under the field instead of under the label. |
disabled | boolean | |
error | string | An error message to show under the field (marks it invalid). Leave it out to let a surrounding Form manage errors. |
headless | boolean | |
label | string | |
maxlength | number | |
maxRows | number | |
minlength | number | |
name | string | |
onChange | (value: string) => void | Every keystroke, like React's onChange on <input>. With value, the field is controlled. |
onClear | () => void | |
onCommit | (value: string) => void | The edit was committed (blur, or Enter in a single-line field). |
onDebouncedInput | (value: string) => void | |
onInput | (value: string) => void | |
placeholder | string | |
radius | 'none' | 'large' | 'full' | string | |
readOnly | boolean | |
required | boolean | |
resize | 'none' | 'both' | 'horizontal' | 'vertical' | |
rows | number | |
showCount | boolean | |
size | 'sm' | 'md' | 'lg' | '1' | '2' | '3' | |
tone | 'brand' | 'success' | 'warning' | 'danger' | |
validation | 'error' | 'success' | 'none' | |
value | string | |
variant | 'classic' | 'surface' | 'soft' | 'filled' | 'ghost' | 'contrast' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Textarea.Label props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Textarea.Description props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Textarea.Error props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-textarea>
Textarea renders the ui-textarea custom element from @editora/ui-core, which can also be used without React.
Attributes: aria-describedby, aria-description, aria-label, autofocus, autosize, clearable, color, counter, data-error, debounce, density, description, disabled, headless, label, max-rows, maxlength, minlength, name, placeholder, radius, readonly, required, resize, rows, show-count, size, tone, validation, value, variant
Events: change, clear, debounced-input, input