Klarhimmel UI

Textarea

Stable

Multi-line text, resizable vertically.

npx shadcn add @klarhimmel/input

When to use

  • Use for

    Messages and notes of a few lines or more.

  • Not for

    One-line answers. Use Input.

  • Pairs with

    Field, contact forms.

Preview

Tell us about allergies or late arrival.

Keep it under 500 characters.

textarea.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { Textarea, Field } from '@/components/klarhimmel/ui/input';

export default function Example() {
  return (
    <Theme theme="brand">
      <Field label="Message">{(p) => <Textarea {...p} />}</Field>
    </Theme>
  );
}

Install

Import

import { Textarea } from '@/components/klarhimmel/ui/input';
Lands in
components/klarhimmel/ui/input.tsx, plus cn() and the theme item if they are missing. Import theme.css after Tailwind.
Render in
Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.

API reference

PropTypeDefaultDescription
rowsnumber5Visible lines before it scrolls.
...textareaTextareaHTMLAttributes-Native attributes are passed through.
classNamestring-Extra classes, merged after the component's own.

Accessibility

KeyDoes
TabMoves into and out of the field
EnterAdds a line