Skip to content
  • System
  • Light
  • Dark
  • High contrast

Textarea

import { Textarea } from '@eekodigital/raster';

<Textarea name="notes" rows={4} placeholder="Add notes…" />
<Textarea name="description" hasError rows={3} placeholder="Description required" />
<Textarea name="notes" defaultValue="Read-only content" disabled rows={3} />
import { TextareaField } from '@eekodigital/raster';

<TextareaField label="Notes" name="notes" rows={4} />
Add any observations about this criterion.
<TextareaField label="Notes" name="notes" hint="Add any observations about this criterion." rows={4} />
Error: Notes cannot be empty.
<TextareaField label="Notes" name="notes" error="Notes cannot be empty." rows={4} />

Pass maxLength to display a live character counter. It switches to error styling when the limit is exceeded.

Describe the issue in detail200 characters remaining
<TextareaField label="Description" maxLength={200} hint="Describe the issue in detail" />
29 characters too many
<TextareaField label="Short note" maxLength={20} defaultValue="This text is too long and will overflow the limit" />
PropTypeDefaultDescription
hasErrorbooleanfalseApplies error styling.
…propsTextareaHTMLAttributes

All native <textarea> attributes.

PropTypeDescription
labelstringVisible label text.
hintstringOptional hint text below the label.
errorstringValidation error message.
maxLengthnumberEnables the live character counter when set.
…propsTextareaHTMLAttributesAll native textarea attributes.