CountedTextarea

Auto-growing textarea with a ring that fills toward the limit. It never blocks typing: past the limit the ring turns red. Inputs.

Open playground

About

CountedTextarea is a React component in the Inputs category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { CountedTextarea } from "@ashutoshswamy/smoui" and set label, limit, ...rest.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { CountedTextarea } from "@ashutoshswamy/smoui";

<CountedTextarea label="Bio" limit={120} placeholder="Tell people what you make" />

Props 3

label

Visible label.

string
limit

Character budget.

numberdefault 280
...rest

Native textarea props. Ref forwarded.

TextareaHTMLAttributes