Textarea
A multi-line field you type in.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/textarea.jsonDefault with counter
States
Tulis alasan agar karyawan tahu kenapa cutinya ditolak.
When to use
- Free text that can be more than one line: Alasan cuti, Alasan penolakan, Alamat, Data baru.
When not to use
- One short line (nama, nomor) → Input.
- A fixed set of answers (Alasan keluar: Resign, PHK …) → Select or RadioGroup; add a Textarea only for "Lainnya".
Do and don't
Say what to writeHelper text "Tulis nama bank, nomor rekening dan nama pemilik." removes guessing.
A Textarea for a choiceAsking "Alasan keluar" as free text makes reports impossible. Use Select, plus a Textarea for "Lainnya".
Installation
Add Textarea with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.
API
import { Textarea } from "@/components/ui/textarea"| Prop | Type | Default | Description |
|---|---|---|---|
aria-invalid | boolean | – | Error edge. Pair with FieldError. |
readOnly · disabled | boolean | – | --muted fill / 60 %. |
maxLength · value · onChange · rows … | native textarea props | – | Show "n / max karakter" as FieldDescription. |