Skip to content

Textarea ​

States

Loading...

A Textarea component for multi-line text input.

  • Tag: <flint-textarea>
  • Class: FlintTextarea

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintTextarea } from 'flint-ui';

Usage ​

html
<flint-textarea></flint-textarea>

Properties ​

PropertyAttributeTypeDefaultDescription
valuevaluestring''Current textarea value.
placeholderplaceholderstring''Placeholder text shown when empty.
disableddisabledbooleanfalseDisables the textarea and prevents interaction.
readonlyreadonlybooleanfalseMakes the textarea read-only.
requiredrequiredbooleanfalseMarks the textarea as required for form validation.
errorerrorbooleanfalseWhether the textarea is in an error state.
errorMessageerror-messagestring''Error message displayed below the textarea.
helpTexthelp-textstring''Help text displayed below the textarea.
labellabelstring''Label text displayed above the textarea.
sizesize'sm' | 'default' | 'lg''default'Size variant of the textarea.
rowsrowsnumber3Number of visible text rows.
maxlengthmaxlengthnumber | undefinedundefinedMaximum number of characters allowed.
minlengthminlengthnumber | undefinedundefinedMinimum number of characters required.
namenamestring''Form field name used when submitting form data.
autocompleteautocompletestring''Browser autocomplete hint.
resizeresize'none' | 'both' | 'horizontal' | 'vertical' | 'auto''vertical'Controls the resize handle. 'auto' enables automatic height expansion as the user types.
defaultValuedefault-valuestring''Initial value for uncontrolled usage.
ariaLabelaria-labelstring | nullnullAccessible label for screen readers when no visible label is provided.

Events ​

EventDetailDescription
flint-textarea-input—Dispatched on every keystroke. Detail: { value: string }
flint-textarea-change—Dispatched on blur/change. Detail: { value: string }

CSS Custom Properties ​

PropertyDefault
--flint-textarea-min-height80px
--flint-font-family—
--flint-label-color—
--flint-input-border-radius—
--flint-input-border-color—
--flint-input-bg—
--flint-text-color—
--flint-input-placeholder-color—
--flint-input-border-hover-color—
--flint-primary-color—
--flint-primary-focus-ring—
--flint-error-color—
--flint-error-focus-ring—
--flint-input-disabled-bg—
--flint-input-disabled-color—
--flint-input-readonly-bg—
--flint-help-text-color—

Methods ​

MethodDescription
textareaElement(): HTMLTextAreaElement | nullDirect access to the internal <textarea> element.