Back to Onyx

InputTextArea

web/lib/opal/src/components/inputs/input-text-area/README.md

4.4.01.2 KB
Original Source

InputTextArea

Import: import { InputTextArea, type InputTextAreaProps } from "@opal/components";

Multiline text field on the shared .opal-input chrome. Accepts standard textarea attributes except disabled and readOnly (use the matching variant), className, and style.

Props

PropTypeDefaultDescription
variantInputVariants"primary"Wrapper chrome variant
rowsnumber4Initial rows and the autoResize minimum. The field has a 48px min-height floor, so values below 2 rows render at the floor
autoResizebooleanfalseGrow with content between rows and maxRows, disables manual resizing
maxRowsnumberRow cap for autoResize, content beyond it scrolls
resizablebooleantrueManual vertical resize handle, ignored with autoResize
rightSectionReactNodeSlot pinned to the top-right inside the field

Usage

tsx
<InputTextArea
  value={value}
  onChange={(event) => setValue(event.target.value)}
  placeholder="Enter a description…"
  autoResize
  rows={2}
  maxRows={8}
/>

The Figma Input family has no dedicated textarea component.