Meridianby Commenda
Components

Textarea

Multi-line text for messages and notes.

Multi-line text, the same field as Input: label, description and error built in, the same border and focus glow, a 16 value and a 14 label. It grows with what people type. On the site it is the message field on demo and contact forms.

A few lines help us bring the right expert to the call.

Usage

Example.tsx
import { TextArea } from "@commenda/meridian/ui/textarea";

<TextArea label="How can we help?" placeholder="e.g. We sell in 30 US states and need to register for sales tax" />;

Field

For anything that might take two sentences or more: what a visitor needs help with, a message to sales, a note on a partner application.

A few lines help us bring the right expert to the call.

Count and resize

A count when there is a limit. Past it the field turns invalid and says by how much. The resize handle is optional and vertical only.

A few lines help us bring the right expert to the call.93 / 500

States

The same states as Input. Invalid replaces the description with the error.

default
disabled
invalid
Tell us a little more, at least 20 characters.

Anatomy

Label row, field, then a bottom row with the description or error on the left and the count on the right. The field starts at 80 and grows.

PartValue
Field80 minimum, radius 8, 1px soft-pearl 400
LabelLabel/14 Strong
Value16
Description, error, count14

API reference

PropTypeDescription
labelConditionalstringFrom Pathfinder.
hideLabelbooleanFrom Pathfinder.
aria-labelConditionalstringFrom Pathfinder.
requiredConditionaltrue | falseFrom Pathfinder.
labelConfigObjectView fields · 2 shapesFrom Pathfinder.
sourceConfigFieldSourceConfigView fieldsFrom Pathfinder.
descriptionstringFrom Pathfinder.
errorConfigObjectView fieldsFrom Pathfinder.
disableConfigDisableConfigView fieldsFrom Pathfinder.
valueConditionalstringFrom Pathfinder.
onValueChangeConditional(value: string) => voidFrom Pathfinder.
defaultValuestringFrom Pathfinder.
variant"plain" | "default"Plain appearance is for embedding in a composite control such as Thread.
resizeConfigObjectView fields · 3 shapesFrom Pathfinder.
actionConfigCopyActionView fieldsFrom Pathfinder.
characterLimitConfigConditionalObjectView fieldsFrom Pathfinder.
maxLengthnumberFrom Pathfinder.
labelConfigObject fields

Choose one of these 2 shapes. Don't combine fields the chosen shape excludes.

Option 1

FieldTypeDescription
optionalLabelRequiredstring

Do not supply: help.

Option 2

FieldTypeDescription
helpRequiredstring

Do not supply: optionalLabel.

sourceConfigObject fields
FieldTypeDescription
kindRequired"entity" | "record" | "document"
labelRequiredstring
previewRequiredReactNode
onOpenRequired() => void
side"top" | "bottom"
errorConfigObject fields
FieldTypeDescription
messageRequiredstring
reveal"after-blur" | "immediate"
disableConfigObject fields
FieldTypeDescription
isDisabledRequiredboolean
reasonstring
resizeConfigObject fields

Choose one of these 3 shapes. Don't combine fields the chosen shape excludes.

Option 1

FieldTypeDescription
modeRequired"auto"
minHeightnumber
maxHeightRequirednumber

Option 2

FieldTypeDescription
modeRequired"manual"
minHeightnumber
maxHeightnumber

Option 3

FieldTypeDescription
modeRequired"fixed"
heightRequirednumber
actionConfigObject fields
FieldTypeDescription
kindRequired"copy"
labelstring
onCopy() => void
onCopyError(error: Error) => void
characterLimitConfigObject fields
FieldTypeDescription
maxRequirednumber

Best practices

  • Use it for messages and notes that may run to two sentences or more. A single value is an Input.
  • A textarea with a send button is a chat composer, not a Textarea.
  • The placeholder is an example that starts with "e.g.", or nothing.
  • Show a count only when there is a limit. Past the limit, the error says by how much.
  • Let it grow with the text up to a maximum, then scroll. Turn the resize handle off when it grows on its own in a fixed layout.
  • Keep it optional on demo forms. A required essay box costs leads.
  • Source: Pathfinder Textarea. Meridian sets the value in 16px, the label in 14 and help and error text in 14.

On this page