TextareaInput()function
TextareaInput({
name,
title = "",
placeholder = title, // Placeholder must be defined or `:placeholder-shown` CSS rules won't show.
required = false,
disabled = false,
message = "",
value,
onValue,
min = 0,
max = Number.POSITIVE_INFINITY,
rows = 2,
formatter = PASSTHROUGH,
className,
...variants
}: TextareaInputProps): ReactElement| Param | Type | |
|---|---|---|
variants | TextareaInputProps | Props for TextareaInput, a multiline text input bound to a string value. required |
.rows | number | Rows the textarea shows at first (its minimum height). It grows to fit its content. Defaults to 2 |
.min | number | |
.max | number | |
.formatter | TextFormatter | Optional formatter — when provided the value is reformatted on blur and when initially displayed (the value published through onValue is never formatted). |
| Return | |
|---|---|
ReactElement | A <textarea> element. |
Multiline text input bound to a string value, rendered as a <textarea> that grows to fit its content.
- Applies an optional
formatteron initial display and on blur — the raw typed value is published throughonValue.
Examples
<TextareaInput name="bio" rows={4} value={bio} onValue={setBio} />