Skip to content
Cloaked Design SystemForms

Textarea

A controlled multiline form field with configurable rows, semantic surfaces, and native length constraints.

Implementation preview
COMPLETE STORYBOOK REFERENCE

Every example. In one place.

Explore every named example, including states, compositions, and theme variants.

9 stories
SELECTED EXAMPLE

Playground

Open controls
Playground selectedOpen canvas
Example sourcepackages/design-system/src/components/forms/Textarea/Textarea.stories.tsxExport Playground

Implementation preview Local Storybook build 0.2.0-preview.1. Source specification status does not approve this runtime.

Stories + source JSON ↗

Local specification source status: preview. Implementation preview pending sign-off.

A controlled multiline form field with configurable rows, semantic surfaces, and native length constraints.

Design-owned component contract ↗Version 0.2.0-preview.1 · Implementation preview pending sign-off
Implementation API 1 entry point · source-derived preview

Read the actual callable API and preserve its composition constraints. Each union branch is a complete alternative; props marked forbidden cannot be supplied.

import { Textarea } from '@cloakedinc/design-system';
TextareaTextareaProps

packages/design-system/src/components/forms/Textarea/Textarea.tsx:44

PropTypePresenceNotes
valuestringRequiredText to render. Controlled — the field shows this and nothing else.
onChange((value: string) => void) | undefinedOptionalCalled with the new text, not the change event.
placeholderstring | undefinedOptionalPlaceholder text. Defaults to `Enter details`.
surfaceTextareaSurface | undefinedOptionalContainer background treatment.Source default: 'default'
ariaLabelstring | undefinedOptionalAccessible name when no visible label is associated with the field.
rowsnumber | undefinedOptionalStarting visible line count. Defaults to 4.Source default: 4
maxLengthnumber | undefinedOptionalMaximum number of characters accepted.
namestring | undefinedOptionalField name used when the surrounding form submits.
onFocus(() => void) | undefinedOptionalCalled when the field takes focus.
onBlur(() => void) | undefinedOptionalCalled when the field loses focus.
classNamestring | undefinedOptional
testIdstring | undefinedOptionalTest id on the `<textarea>` itself.
idstring | undefinedOptionalDOM id the control renders, which the Field's label points at.
disabledboolean | undefinedOptionalBlocks interaction and dims the control.
requiredboolean | undefinedOptionalMarks the control required for native form semantics.
invalidboolean | undefinedOptionalPaints the invalid treatment and announces the control as invalid. A Field supplies this from its own `error`; set it directly only for a control with no Field around it.
ariaDescribedBystring | undefinedOptionalIds of the helper or error copy describing the control, supplied by a parent Field.
ariaLabelledBystring | undefinedOptionalId of the visible label naming the control, supplied by a parent Field.

Only explicit destructured parameter initializers are extracted. Other runtime defaults remain in implementation source.

Overview

The multiline free-text control — token-styled to match Input but sized in rows.

When to use

Reach for Textarea when the answer is open-ended and can run past one line — notes, a removal-request message, freeform feedback. Size the resting height with rows and cap entry with maxLength.

  • Editing a single-line value (a name, email, URL, short query)? Use Input — it's the same visual treatment on one line.
  • Wrap it in Field for a label and helper/error copy. The Field's error turns this box red on its own; invalid is the escape hatch for a box with no Field around it.

In-app it backs the Playlist home feedback card (HomeFeedbackCard).

Component specification

$schema../../../specs/component-spec.schema.json
Parts
Id
root
Label
Root
Description
Carries the caller's class around the multiline field.
Id
field
Label
Multiline field
Description
Native textarea that owns value, rows, form, focus, validation, and disabled semantics.
Id
placeholder
Label
Placeholder
Description
Temporary hint shown only while the field is empty.
Allowed Design Choices
Variants
Base
Label
Base
Description
One multiline treatment configured through the independent surface axis.
Sizes
Surfaces
Default
Label
Default
Description
Uses the semantic input container.
Raised
Label
Raised
Description
Uses the raised surface when placed directly on the page canvas.
Variants
Id
base
Label
Base
Description
Multiline native field with row-driven content capacity.
Platforms
  • ios
  • android
  • web
SizesNone specified
Measurements
Id
minimum-height
Label
Minimum field height
Kind
exact
Token
--cds-size-120
Value
120
Unit
px
Applies To
  • field
Id
vertical-padding
Label
Vertical field padding
Kind
exact
Token
--cds-space-20
Value
20
Unit
px
Applies To
  • field
Id
horizontal-padding
Label
Horizontal field padding
Kind
exact
Token
--cds-space-24
Value
24
Unit
px
Applies To
  • field
Id
corner-radius
Label
Field corner radius
Kind
exact
Token
--cds-radius-md
Value
16
Unit
px
Applies To
  • field
Layout
Alignment
Text begins at the field's top-leading content inset; the enclosing Field's error message aligns below.
Flow
One multiline native field.
Notes
  • Rows may increase the resting height but never reduce it below the approved minimum.
  • Use Field for a persistent label and helper copy.
Typography And Color
Typography
Label
Field text
Description
Use the body ramp for entered text and placeholders.
Token
--cds-type-body-size
Colors
Label
Default surface
Description
Use the semantic input container.
Token
--cds-input-container
Label
Raised surface
Description
Use the raised semantic surface.
Token
--cds-bg-surface
Label
Entered text
Description
Use primary text emphasis.
Token
--cds-text-primary
Label
Placeholder
Description
Use secondary text emphasis at full opacity.
Token
--cds-text-secondary
Label
Validation
Description
Use the solid danger role for invalid border and copy.
Token
--cds-status-danger-solid
States
Id
empty
Label
Empty
Description
Shows the explicit or default placeholder.
Id
filled
Label
Filled
Description
Shows controlled multiline content in primary text.
Id
focused
Label
Focused
Description
Accepts multiline editing. Draws no focus ring: the runtime is a touch-only WebView with no keyboard navigation, and the caret plus the on-screen keyboard already mark the active field.
Id
invalid
Label
Invalid
Description
Shows the danger border and invalid semantics. The corrective message belongs to the enclosing Field.
Id
disabled
Label
Disabled
Description
Blocks editing and dims the field.
Behavior
Label
Controlled editing
Description
Request each next string value while the parent owns rendered content.
Label
Rows
Description
Use the native rows value to express expected content capacity without replacing the minimum geometry.
Label
Length constraint
Description
Forward maxLength to native editing and form semantics.
Label
Resize
Description
Allow vertical web resizing only; never permit horizontal resizing to break the form width.
Accessibility
Label
Accessible name
Description
Associate a visible Field label or provide an accessible label for standalone usage.
Label
Validation
Description
Expose required, disabled, invalid, and described-by state through the native textarea.
Label
Placeholder
Description
Never use placeholder copy as the only persistent label for a complex form.
Content Adaptation
Label
Long content
Description
Wrap and vertically scroll long content while preserving the control width.
Label
Capacity cues
Description
Choose rows and maxLength from the expected answer rather than shrinking all multiline fields to one line.
Motion Haptics
Motion
Label
Focus and validation
Description
Change focus and error indication without moving entered content.
Haptics
Label
No intrinsic feedback
Description
Typing, focus, and validation do not request design-system haptics.
Platform Differences
Platforms
  • web
Description
Web exposes a vertical drag-resize affordance; iOS and Android rely on intrinsic text-view scrolling and layout.
Rationale
Pointer resizing is useful in Storybook and desktop web contexts but is not a native mobile interaction.
Implementation preview

This design-owned implementation is ready to try and review. It does not establish product approval. Imported specifications retain their original review status.

Inspect version 0.2.0-preview.1