Skip to main content

TextArea

Captures longer text content from merchants with a multi-line, resizable text input area.

string

Additional text to provide context or guidance for the field. This text is displayed along with the field and its label to offer more information or instructions to the user.

This will also be exposed to screen reader users.

boolean
Default: false

Disables the field, disallowing any interaction.

string

Indicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately.

string

A unique identifier for the element.

string

Content to use as the field label.

number
Default: Infinity

Specifies the maximum number of characters allowed.

string

A short hint that describes the expected value of the field.

boolean
Default: false

Whether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the error property.

number
Default: 2

A number of visible text lines.

string

The current value for the field. If omitted, the field will be empty.

Was this section helpful?

Learn more about using slots

HTMLElement

Additional content to be displayed in the field. Commonly used to display clickable text.

Was this section helpful?

Learn more about registering events

(event: <"s-text-area">) => void

Callback when the element loses focus.

(event: <"s-text-area">) => void

Callback after editing completes (typically on blur).

(event: <"s-text-area">) => void

Callback when the element receives focus.

(event: <"s-text-area">) => void

Callback when the user makes any changes in the field.

Was this section helpful?

Code

<s-text-area
label="Shipping address"
value="1776 Barnes Street, Orlando, FL 32801"
/>

Preview

TextArea usage patterns

Configure visible rows and character limits

Handle text area events

Add action buttons using the accessory slot. Only s-button and s-clickable are supported

Was this section helpful?

Rows configuration

<s-text-area
label="Order notes"
placeholder="Add special instructions..."
rows={5}
maxLength={500}
onInput={(event) => console.log('Characters:', event.target.value.length)}
/>