Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
Textarea

Multi-line fields to get long user inputs.

The Textarea component allows users to enter multi-line text. It is commonly used for longer inputs such as comments, messages, or descriptions.
Example
Code

Usage

Import the component


_10
import { Textarea } from "@faststore/ui";

Import styles

To apply styles, include the following in your stylesheet:

_10
@import "@faststore/ui/src/components/atoms/Textarea/styles.scss";


Examples

Resize

Vertical

Example
Code

Horizontal

Example
Code

Both (default)

Example
Code

Disabled

Example
Code

Design tokens

Local tokenDefault value/Global token linked
--fs-textarea-paddingvar(--fs-spacing-1) var(--fs-spacing-2)
--fs-textarea-heightcalc(var(--fs-control-tap-size) * 3)
--fs-textarea-bkg-color
var(--fs-color-body-bkg)
--fs-textarea-box-shadownone
--fs-textarea-box-shadow-hover0 0 0 var(--fs-border-width) var(--fs-border-color-active)
--fs-textarea-border-radiusvar(--fs-border-radius)
--fs-textarea-border-widthvar(--fs-border-width)
--fs-textarea-border-color
var(--fs-border-color)
--fs-textarea-border-color-hover
var(--fs-border-color-active)
--fs-textarea-text-color
var(--fs-color-text)
--fs-textarea-text-sizevar(--fs-text-size-body)
--fs-textarea-line-height1.25
--fs-textarea-transition-functionvar(--fs-transition-function)
--fs-textarea-transition-propertyvar(--fs-transition-property)
--fs-textarea-transition-timingvar(--fs-transition-timing)

Design tokens: Disabled

Disabled textareas reduce contrast and remove interactive indicators to show a non-editable state, while maintaining layout stability and keeping content readable.
Local tokenDefault value/Global token linked
--fs-textarea-disabled-bkg-color
var(--fs-color-disabled-bkg)
--fs-textarea-disabled-border-widthvar(--fs-border-width)
--fs-textarea-disabled-text-color
var(--fs-color-disabled-text)
--fs-textarea-disabled-border-color
var(--fs-border-color)

Data attributes

You can target and override Textarea styles using the following data attributes:
data-fs-textarea
data-fs-textarea-resize

Props

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-textarea
resize"none" | "vertical" | "horizontal" | "both"Controls the resize property of the textare (e.g.: none, vertical, horizontal, both). Default is 'both'.both

Best practices

✅ Do's

  • Provide a Label to help users understand the purpose of the form control.
  • Ensure each Textarea has an associated id that matches the for attribute of its label.
  • Use placeholders only for examples or hints, not as replacements for labels.
  • Set a height that shows multiple lines without requiring immediate resizing.
  • Add validation messages when specific input formats or lengths are required.
  • Make disabled or error states visually clear and accessible to screen readers.

❌ Don'ts

  • Don't overuse resizing. If resizing is enabled, ensure it doesn't break the layout or cause accessibility issues.
  • Don't use Textarea for short inputs. For single-line or brief text, such as names or emails, use the Input component.

Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page