Skip to content
ComponentsMarkdown

Textarea

Multi-line text control with size-matched minimum heights (xs to lg) and vertical resizing (resize-y). Keeps a 16px (--text-body) font size at every size and connects to Field automatically.

Live example

Characters: 36

Props

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg""md"Minimum height and corner radius tier.
rowsnumberbrowser defaultInitial visible text lines before vertical resizing.
aria-invalidboolean | "true" | "false"falseSwitches the border to --destructive; wired automatically inside Field.
readOnlybooleanfalseApplies a step 2 muted surface with a top-right lock icon while remaining focusable.
disabledbooleanfalseDisables editing using step 3 background and step 8 text without opacity.

Sizes and tokens

Tier / RoleTokenValue
xs--control-height-xs / --control-radius-xs24px min-height · radius-sm (4px) · 16px text
sm--control-height-sm / --control-radius-sm32px min-height · radius-sm (4px) · 16px text
md--control-height-md / --control-radius-md40px min-height · radius-md (8px) · 16px text
lg--control-height-lg / --control-radius-lg48px min-height · radius-md (8px) · 16px text
Resizeresize-yVertical resize enabled; horizontal resize locked
Read-only--muted / --foreground / --control-icon-*Step 2 surface · normal text · top-right Lock icon · focusable

States

Code

import { Field, Textarea } from "@freshgemui/monoplinth";

export function Example() {
  return (
    <Field label="Release summary" description="Summarize breaking changes.">
      <Textarea rows={4} placeholder="Enter release notes..." />
    </Field>
  );
}

Do and don't

Do: Lock resizing to vertical and pair with Field
Use resize-y so user resizing never breaks horizontal grid columns, and wrap Textarea in Field for accessible labels and error wiring.
Don't: Allow horizontal resize or show errors with border color alone
Do not enable resize-both inside narrow layouts, and always pair aria-invalid with visible error text.

Accessibility

  • Inherits id, aria-describedby, aria-invalid, and aria-required from Field context automatically.
  • Locks font size at 16px (text-body) across all sizes to prevent mobile zoom on focus.
  • Renders a 2px --ring outline with a 2px offset on :focus-visible only.
  • Uses step 3 background and step 8 text (no opacity) when disabled.

Rationale

Binding Textarea minimum height and corner radius to --control-height-* and --control-radius-* keeps multi-line fields visually consistent with single-line Input controls while permitting vertical expansion.