Documentation
Feedback
Guides
Storefront Development

Storefront Development
FastStore
Textarea

Multi-line fields to get long user inputs.

Textarea enables users to input multi-line text. It's commonly used for longer user inputs, such as comments or descriptions.
Example
Code

Import

Import the component from @faststore/ui

_10
import { Textarea } from '@faststore/ui'

Import styles to your FastStore project

To apply the styles of this component in your FastStore project, import the following to your stylesheet:

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

Follow the instructions in the Importing FastStore UI component styles tutorial.

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

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)

Variants

Disabled


_10
<Textarea placeholder="Text area disabled" id="textareafield-disabled" disabled />

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)

Customization

For further customization, you can use the following data attributes:
data-fs-textarea
data-fs-textarea-resize

Best practices

✅ Do's

  • Provide a Label when using Textarea. Descriptive labels help users understand the purpose of a form control.

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