Skip to main content
Version: Next

Textarea API

import { Textarea } from '@editora/ui-react';

Props​

PropTypeDescription
autofocusboolean
autosizeboolean
childrenReact.ReactNode
clearableboolean
colorstring
counterbooleanSame as showCount, named like Input's prop.
debouncenumber
defaultValuestringStarting value of an uncontrolled field (written once, on mount).
density'compact' | 'default' | 'comfortable'
descriptionstring
descriptionPosition'above' | 'below'Put the description under the field instead of under the label.
disabledboolean
errorstringAn error message to show under the field (marks it invalid). Leave it out to let a surrounding Form manage errors.
headlessboolean
labelstring
maxlengthnumber
maxRowsnumber
minlengthnumber
namestring
onChange(value: string) => voidEvery keystroke, like React's onChange on <input>. With value, the field is controlled.
onClear() => void
onCommit(value: string) => voidThe edit was committed (blur, or Enter in a single-line field).
onDebouncedInput(value: string) => void
onInput(value: string) => void
placeholderstring
radius'none' | 'large' | 'full' | string
readOnlyboolean
requiredboolean
resize'none' | 'both' | 'horizontal' | 'vertical'
rowsnumber
showCountboolean
size'sm' | 'md' | 'lg' | '1' | '2' | '3'
tone'brand' | 'success' | 'warning' | 'danger'
validation'error' | 'success' | 'none'
valuestring
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