Carregando…
Carregando…
Carregando…Multi-line text input with auto-resize, count, 4 variants and validation states.
$ npx kikitocn add textarea@/lib/utilsimport { Textarea } from "@/components/ui/cn/textarea/Textarea";
export function TextareaExample() {
return (
<Textarea
label="Mensagem"
placeholder="Escreva aqui..."
hint="Máximo 500 caracteres"
rows={4}
/>
);
}
// floatingLabel — label flutua pro topo quando o campo ganha valor/foco
export function TextareaFloatingLabelExample() {
return <Textarea label="Mensagem" floatingLabel rows={4} />;
}| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
variant | 'outline' | 'filled' | 'ghost' | 'outline' | Estilo visual do textarea |
size | 'sm' | 'md' | 'lg' | 'md' | Tamanho do textarea |
state | 'default' | 'error' | 'success' | 'warning' | 'default' | Estado visual de validação |
label | string | undefined | Label acima do textarea |
helperText | string | undefined | Texto de apoio abaixo do textarea |
errorText | string | undefined | Mensagem de erro (força state='error') |
successText | string | undefined | Mensagem de sucesso (força state='success') |
warningText | string | undefined | Mensagem de aviso (força state='warning') |
showCount | boolean | false | Exibe contador de caracteres (requer maxLength) |
autoResize | boolean | false | Cresce automaticamente conforme o conteúdo |
maxRows | number | undefined | Limite máximo de linhas no auto-resize |
resize | 'none' | 'vertical' | 'horizontal' | 'both' | 'vertical' | Controla qual direção pode ser redimensionada |
className | string | — | Classes CSS extras |
Outline (default)
Filled
Ghost
Error · success
Auto-resize · char count
Floating label (paridade com Input.floatingLabel)