Skip to content

Textarea ​

A multi-line text input with integrated label, helper text, character counter, and auto-resize. Form-associated and fully keyboard accessible.

Variants ​

Full width

Colors ​

Full width

Sizes ​

Full width

Labels ​

Inset (Default) ​

The label floats inside the field as a compact top label.

Full width

Outside ​

The label is placed above the field.

Full width

Helper & Error Text ​

Full width

Character Counter ​

Set maxlength to enable a live character counter. The counter turns amber near the limit and red at the limit. Set maxlength whenever a backend constraint exists: the counter provides live feedback to users.

Full width

Auto Resize ​

Set auto-resize to let the textarea grow vertically with its content. Manual resize is automatically disabled. This is useful for comment or note fields where content length is unpredictable. Note that rows still sets the minimum starting height when used alongside auto-resize.

Full width

Resize Control ​

Control the resize handle with the resize attribute. Avoid resize="horizontal" on full-width layouts as it breaks layout flow.

Full width

States ​

Full width

API Reference ​

Attributes ​

AttributeTypeDefaultDescription
labelstring''Label text
label-placement'inset' | 'outside''inset'Label placement
valuestring''Current value
namestring''Form field name
placeholderstring''Placeholder text
enterkeyhintEnterKeyHintUnsetNative virtual-keyboard return-key label
rowsnumber-Visible row count (sets minimum height)
maxlengthnumber-Maximum character count: enables counter when set
helperstring''Helper text below the field
errorstring''Error message (marks field invalid)
disabledbooleanfalseDisable the textarea
readonlybooleanfalseMake the textarea read-only
requiredbooleanfalseMark the field as required
fullwidthbooleanfalseExpand to full width
auto-resizebooleanfalseGrow vertically with content
no-resizebooleanfalseDisable the manual resize handle
resize'none' | 'vertical' | 'horizontal' | 'both''vertical'Resize direction
variant'solid' | 'flat' | 'bordered' | 'outline' | 'ghost''solid'Visual style variant
color'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'-Color theme
size'sm' | 'md' | 'lg''md'Component size
rounded'none' | 'sm' | 'md' | 'lg' | 'full'-Border radius override

Slots ​

SlotDescription
helperComplex helper content below the field

Events ​

EventDetailDescription
input{ value: string, originalEvent: Event }Fired on every keystroke
change{ value: string, originalEvent: Event }Fired when value is committed (on blur)

CSS Custom Properties ​

PropertyDescriptionDefault
--textarea-bgBackground colorVariant-dependent
--textarea-border-colorBorder colorVariant-dependent
--textarea-radiusBorder radiusvar(--radius)
--textarea-paddingInner padding (block inline)var(--size-2) var(--size-3)
--textarea-gapGap between label and fieldSize-dependent
--textarea-font-sizeFont sizevar(--text-sm)
--textarea-placeholder-colorPlaceholder text colorTheme-dependent
--textarea-min-heightMinimum field heightvar(--size-24)
--textarea-max-heightMaximum field height (none = unlimited)none
--textarea-resizeCSS resize direction (vertical/horizontal/both/none)vertical
--textarea-hover-bgField background on hover (flat/ghost variants)Variant-dependent
--textarea-hover-border-colorField border on hover (flat/bordered variants)Variant-dependent
--textarea-focus-bgField background when focused (flat/bordered variants)Variant-dependent
--textarea-focus-border-colorField border when focused (flat variant)Variant-dependent

Accessibility ​

The textarea component follows WCAG 2.1 Level AA standards.

Keyboard navigation uses Tab to focus the field and Shift+Tab to blur it. Native textarea keyboard behaviour applies within the field.

aria-labelledby links the label to the field and aria-describedby links helper and error text. aria-invalid is set when error is provided, aria-required reflects the required attribute, and aria-disabled reflects the disabled state. Always provide a label: do not rely solely on placeholder, as placeholder text is not exposed as an accessible label. Use error to surface server-side validation messages after submit.