Textarea API

API reference docs for theTextareacomponent. For examples and details on the usage of this component, visit the component demo page.

Props

Props

Type

Description

Default

defaultValue?

string

The initial value of the textarea. This is used when the component is uncontrolled.

_

value?

string

The controlled value of the textarea. Use this with onChange to create a controlled component.

_

placeholder?

string

Placeholder text displayed when the textarea is empty.

_

disabled?

boolean

When true, prevents the user from interacting with the textarea.

false

row?

number

Specifies the visible number of lines in the textarea.

3

onBlur?

(event: FocusEvent<HTMLTextAreaElement>) => void

Callback function that fires when the textarea loses focus.

_

onChange?

(event: ChangeEvent<HTMLTextAreaElement>) => void

Callback function that fires when the textarea's value changes.

_

onFocus?

(event: FocusEvent<HTMLTextAreaElement>) => void

Callback function that fires when the textarea receives focus.

_

onKeyDown?

(event: KeyboardEvent<HTMLTextAreaElement>) => void

Callback function that fires when a key is pressed while the textarea is focused.

_

Note: Starting from eds-core@1.21.0, the Textarea supports all native HTML <textarea> attributes and event listeners (e.g., onPaste, onCut, aria-*, etc.) out of the box.