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

Examples are the tab where the component is shown doing a job, not demonstrating a prop. The API tab already lists the props.

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

Press Compare. The frames are real viewports, so a layout that breaks at 320 breaks here too rather than in somebody's hands.

In a page

import { Field, Textarea } from "@sushindustries/ui";
import { useState } from "react";

export function FeedbackForm() {
	const [message, setMessage] = useState("");

	return (
		<form className="flex flex-col gap-4">
			<Field label="What happened" hint="As much detail as you can give">
				<Textarea
					value={message}
					onChange={(event) => setMessage(event.target.value)}
					placeholder="Say what happened, in order."
				/>
			</Field>
			<button type="submit" className="btn">
				Send
			</button>
		</form>
	);
}
tsx

What this example is not

There is no character counter or max-length handling here - maxLength is a native attribute TextareaTextareaA textarea in the same clothes as Input, growing with its content where the browser allows.@sushindustries/ui · content passes through untouched, but showing the count as someone types is markup the caller adds, not something this component renders for you.