Multi-line text entry with optional automatic sizing.
import { useState } from 'react';
import { Textarea } from '@vrum/ui';
export default function Demo() {
const [value, setValue] = useState("");
return (
<Textarea
value={value}
placeholder={"Add a project description…"}
rows={4}
disabled={false}
autoSize={false}
onChange={(event) => setValue(event.target.value)}
/>
);
}Copy code| Prop | Type | Default | Description |
|---|---|---|---|
autoSize | boolean | false | auto size configuration. |
disabled | boolean | none | Disable user interaction. |
maxLength | number | none | max length configuration. |
name | string | none | name configuration. |
placeholder | string | none | Hint shown when no value is entered. |
readOnly | boolean | none | read only configuration. |
required | boolean | none | required configuration. |
rows | number | none | rows configuration. |
value | string | number | readonly string[] | none | Controlled value; connect the callback to application state. |
onChange | ChangeEventHandler<HTMLTextAreaElement, HTMLTextAreaElement> | none | Called when the input value changes. |
defaultChecked | boolean | none | default checked configuration. |
defaultValue | string | number | readonly string[] | none | Initial value for an uncontrolled component. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | Defines a string value that labels the current element. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLTextAreaElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLTextAreaElement> | none | on blur configuration. |
onSubmit | SubmitEventHandler<HTMLTextAreaElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLTextAreaElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLTextAreaElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLTextAreaElement> | none | on select configuration. |