@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.
import { Textarea } from "@lattice-ui/textarea";
import React from "@rbxts/react";
export function TextareaExample() {
const [value, setValue] = React.useState("First line\nSecond line");
return (
<frame BackgroundTransparency={1} Size={UDim2.fromOffset(460, 260)}>
<Textarea.Root onValueChange={setValue} value={value}>
<frame BackgroundTransparency={1} Size={UDim2.fromOffset(420, 220)}>
<uilistlayout
FillDirection={Enum.FillDirection.Vertical}
Padding={new UDim(0, 6)}
/>
<Textarea.Label asChild>
<textbutton
AutoButtonColor={false}
BackgroundTransparency={1}
BorderSizePixel={0}
Size={UDim2.fromOffset(420, 22)}
Text="Notes"
TextColor3={Color3.fromRGB(236, 240, 248)}
TextSize={14}
TextXAlignment={Enum.TextXAlignment.Left}
/>
</Textarea.Label>
<Textarea.Input asChild>
<textbox
BackgroundColor3={Color3.fromRGB(34, 41, 54)}
BorderSizePixel={0}
Size={UDim2.fromOffset(420, 110)}
TextColor3={Color3.fromRGB(236, 240, 248)}
TextSize={14}
TextWrapped={true}
TextXAlignment={Enum.TextXAlignment.Left}
TextYAlignment={Enum.TextYAlignment.Top}
>
<uicorner CornerRadius={new UDim(0, 8)} />
<uipadding
PaddingBottom={new UDim(0, 8)}
PaddingLeft={new UDim(0, 10)}
PaddingRight={new UDim(0, 10)}
PaddingTop={new UDim(0, 8)}
/>
</textbox>
</Textarea.Input>
<Textarea.Description asChild>
<textlabel
BackgroundTransparency={1}
Size={UDim2.fromOffset(420, 18)}
Text="Textarea keeps the same labeled field shell as TextField while supporting multi-line input."
TextColor3={Color3.fromRGB(172, 181, 196)}
TextSize={13}
TextWrapped={true}
TextXAlignment={Enum.TextXAlignment.Left}
/>
</Textarea.Description>
</frame>
</Textarea.Root>
</frame>
);
} 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 textareaPublic Exports
-
Textarea -
Textarea.Root -
Textarea.Input -
Textarea.Label -
Textarea.Description -
Textarea.Message -
resolveTextareaHeight
State Model
Textarea.Rootshares the same controlled/uncontrolled value model asTextField, with additionalautoResize,minRows, andmaxRowsstate.autoResizedefaults totrue, and row constraints are normalized sominRowsis at least one andmaxRowsnever falls below it.onValueCommitremains 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
autoResizeis on by default, so opt out explicitly if the layout depends on fixed input height.- Use
TextFieldinstead when the input must stay single-line and commit semantics matter more than row growth.