Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Core

Textarea

Multi-line text field with a label, hint and error. autoResize grows it with its content, up to maxRows.

import { Textarea } from "@stylhero/ui";

Example

Code
import { Textarea } from "@stylhero/ui";

function TextareaExample() {
  return <Textarea label="Notes" hint="Grows as you type, up to 6 lines." autoResize maxRows={6} />;
}

Props

PropTypeDefaultDescription
autoResize boolean - Grow with the text instead of scrolling (MUI's TextareaAutosize). Cap it with maxRows.
error ReactNode -
hint ReactNode - Help text under the field. Replaced by error when set.
label ReactNode -
maxRows number -

Also takes every <textarea> attribute (id, style, data-*, aria-*, event handlers…), passed to that element. Takes a ref.

Accessibility

  • The label, hint and error are linked to the control (aria-describedby), and error sets aria-invalid.

Generated from src/components/Textarea.tsx. Something wrong or missing? Open an issue.