Textarea

Headless multi-line text input primitives for Roblox UI with optional auto-resize behavior.

Stable direction
@lattice-ui/textarea

Part of the stable direction toward v1.0.

What It Is For

Use Textarea for multi-line text entry when the field should support the same labeled-field semantics as TextField but with optional automatic resizing.

It works well for notes, descriptions, and admin surfaces that need larger freeform input.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add textarea

Monorepo local script

Use your package manager wrapper when running the local lattice command.

pnpm lattice add textarea

npm package: @lattice-ui/textarea

Peer dependencies

  • @rbxts/react
  • @rbxts/react-roblox

Public Exports

  • Textarea
  • Textarea.Root
  • Textarea.Input
  • Textarea.Label
  • Textarea.Description
  • Textarea.Message
  • resolveTextareaHeight

State Model

  • Textarea.Root shares the same controlled/uncontrolled value model as TextField, with additional autoResize, minRows, and maxRows state.
  • autoResize defaults to true, and row constraints are normalized so minRows is at least one and maxRows never falls below it.
  • onValueCommit remains distinct from live text changes, and disabled/read-only roots reject writes.

Key API

Textarea.Root

Use value, defaultValue, onValueChange, onValueCommit, autoResize, minRows, and maxRows to define the field model.

Textarea.Input

Use lineHeight with asChild when your visual host needs explicit row-height control.

Textarea.Label / Description / Message

Use the same companion parts as TextField to keep field messaging aligned with the current state.

Composition Patterns

Auto-growing notes fields

Leave autoResize enabled when the field should expand naturally with content up to a defined row ceiling.

Structured long-form settings

Combine a textarea with helper and validation text when the app needs multi-line input but still wants the same field-shell contract as TextField.

Cautions / Limits

  • autoResize is on by default, so opt out explicitly if the layout depends on fixed input height.
  • Use TextField instead when the input must stay single-line and commit semantics matter more than row growth.