Textarea

@sushindustries/ui

A textarea in the same clothes as Input, growing with its content where the browser allows.

4 min read
View as MarkdownEdit on GitHub

A textarea styled like Input, using field-sizing: content so it grows with what's typed wherever the browser supports it, with a rows fallback where it doesn't. Reach for it for multi-line free text - a message, a description - where the number of lines isn't known ahead of time.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/textarea.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/textarea.json

Why it is built this way

Textarea is a native <textarea> with two additions: a default of 4 rows, and the same field-control class Input carries, so the two feel like siblings rather than related-but-different controls. field-sizing: content does the actual growing where the browser supports it; rows is what shows before anything is typed, and the honest fallback everywhere else.

Install commands are not written here

Anything in packages/ui/registry.ts gets its TanStack and shadcn commands attached automatically, so there is nothing to keep in sync.

Install

tanstack add https://adamjurek.com/r/tanstack/textarea.json
shell
pnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/textarea.json
shell
pnpm add @sushindustries/ui @sushindustries/atoms
shell

What you get

Version0.1.0
Categorycontent · Forms
Filestextarea.tsx
DependenciesNone
Tagsform, no-deps

No runtime dependencies

It brings nothing with it beyond the stylesheet.