Skip to content
Storybook

Textarea

Multi-line text field with label, hint and character counter.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Visible to your team.

0/200

Usage

  • Use for answers longer than one line.
  • Show the limit before people hit it.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

Error

Add a short description.

API reference

Class / attributeTypeDescription
px-input--textareaclassTextarea variant of px-input. Resizes vertically.

Figma properties

Textarea12 variants · page “Input Fields”Open

Multi-line text field with label, hint and character counter. Resizable vertically in code; min height --px-textarea-height.

PropertyTypeValues
LabelText“Description”
HintText“Visible to your team.”
Show labelBoolean—
Show hintBoolean—
RequiredBoolean—
Error messageText“Add a short description.”
StateVariantActive Hover Focused Filled Disabled Error
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-input-content-placeholdercolor-content-neutral-placeholder#667085
--px-input-content-labelcolor-content-neutral-secondary#475467
--px-input-content-hintcolor-content-neutral-tertiary#667085
--px-input-content-errorcolor-content-danger-default#b42318
--px-input-radiusradius-1212px
--px-input-height-mdspacing-4040px
--px-input-padding-xspacing-1212px
--px-input-height-smspacing-3636px
--px-input-height-lgcontrol-height-lg48px
--px-input-gapspacing-88px
--px-input-field-gapspacing-88px
--px-input-width320px320px
--px-textarea-height120px120px
--px-textarea-padding-xspacing-1212px
Show all 16 tokens
TokenAliasLight value
--px-textarea-padding-yspacing-1212px
--px-input-focus-halo#2563eb2e#2563eb2e

Accessibility

  • Same rules as Input. Announce counters politely, not on every key.