Text area

Multi-line entry, with an optional character counter and a drag handle. Hover the field to see the hover state. It is a real pointer state, not a pill.

(Optional)
This is a hint text to help users.
<Textarea
  size="md"
  label="Input area"
  required
  optional
  info="We only use this to improve the product."
  maxLength={200}
  hint="This is a hint text to help users."
/>

Sizes

Three, on the shared size scale.

sizeHeightRadiusNotes
sm113px8pxFigma X-Small.
md127px12pxFigma Small. The default.
lg141px12pxFigma Medium.

Props

PropTypeDefaultNotes
requiredbooleanfalseRenders the asterisk and sets aria-required.
optionalbooleanfalseRenders the muted "(Optional)" note.
infostringAdds an info marker after the label, with this as its tooltip.
maxLengthnumberCaps the value and turns the counter on.
showCounterbooleanautoOn whenever maxLength is set. Pass false to hide it.
resizablebooleantrueShow the drag handle that resizes the field.

Shared

PropTypeDefaultNotes
valuestringControlled value.
defaultValuestringInitial value when uncontrolled.
onChange(value: string) => voidReceives the value, never the event.
labelReactNodeRendered as a real <label> wired by htmlFor.
hintReactNodeHelper text under the field.
errorReactNodeError text. Implies invalid unless invalid says otherwise.
invalidbooleanForces the error styling on or off.
errorKeystring | numberChange it to replay the error animation.
disabledbooleanfalseGreys the field out.
readOnlybooleanfalseReads as filled, stays focusable.
size'sm' | 'md' | 'lg''md'Size scale, where the component defines one.
classNamesRecord<Part, string>Per-part class names.

Resizing

The handle is a real drag, not the browser's native resize, which draws its own corner widget on top of the mark and only works from the bottom-right corner. Dragging writes to --yote-ta-height, which means you can set the same property yourself to pick a starting height.

<Textarea
  label="Input area"
  style={{ '--yote-ta-height': '200px' }}
/>

Custom properties

Every measured value is a property on the root, so one field can be retuned without a stylesheet.

PropertyControls
--yote-ta-heightField height. The drag handle writes to this one.
--yote-ta-radiusCorner radius.
--yote-ta-pad-yVertical padding.
--yote-ta-pad-leftLeft padding.
--yote-ta-pad-rightRight padding. Tighter than the left, to sit the handle near the edge.