Skip to Content

Textarea

A form component providing adjustable multi-line bounding inputs for lengthy textual responses. 

Disabled

Use the disabled attr or the disabled class to disable a component.

Valid

Use the data-valid attr or the valid class to indicate an valid state.

The quick brown fox jumps over
Name is valid

Invalid

Use the data-invalid attr or the invalid class to indicate an invalid state.

The quick brown fox jumps over
Name is required

Controlled

Use the value and onChange props when you need to control the value externally.

Uncontrolled

Use the name prop to include the value in the form submission.

Sizes

Use the textarea-{size} class to control the component size.

Size values can include:smmdlg.

For more information on all available sizing utilities, visit Tailwind 

Variants

Use the variant and palette classes to control the appereance of the component.

Variant values can include solidoutlinesurfacesubtle.
Color palettes can include primaryneutral. For extra palettes such as warning error and more, refer to the Colors section.

Customizing

globals.css
:root { --ex-textarea-font-family: var(--font-sans); --ex-textarea-font-weight: var(--font-weight-normal); --ex-textarea-font-size-sm: var(--text-xs); --ex-textarea-font-size-md: var(--text-sm); --ex-textarea-font-size-lg: var(--text-base); --ex-textarea-px-sm: calc(var(--spacing) * 3.5); --ex-textarea-px-md: calc(var(--spacing) * 4); --ex-textarea-px-lg: calc(var(--spacing) * 4.5); --ex-textarea-py-sm: calc(var(--spacing) * 2.5); --ex-textarea-py-md: calc(var(--spacing) * 3); --ex-textarea-py-lg: calc(var(--spacing) * 3.5); --ex-textarea-radius-sm: var(--radius-sm); --ex-textarea-radius-md: var(--radius-sm); --ex-textarea-radius-lg: var(--radius-sm); }

API

Textarea

ElementSelector
Textarea.ex-textarea
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Textarea Field

ElementSelector
Textarea.Field.ex-textarea-field
PropTypeDefault
asElementTypetextarea
asChildbooleanfalse
Last updated on