Carregando…
Carregando…
Carregando…Drag-and-drop or button file upload with preview, size limit, multi-file and accept types.
$ npx kikitocn add file-upload@/lib/utilsimport { FileUpload } from "@/components/ui/cn/file-upload/FileUpload";
export function FileUploadExample() {
return (
<FileUpload />
);
}| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
accept | string | undefined | Tipos de arquivo aceitos (ex: 'image/*,.pdf') |
multiple | boolean | false | Permite seleção de múltiplos arquivos |
maxSize | number | undefined | Tamanho máximo em bytes por arquivo |
maxFiles | number | undefined | Número máximo de arquivos |
onFiles | (files: File[]) => void | undefined | Callback com a lista de arquivos selecionados |
variant | 'dropzone' | 'button' | 'dropzone' | Estilo visual: área de drop ou botão simples |
size | 'sm' | 'md' | 'lg' | 'md' | Tamanho do componente |
label | string | undefined | Texto principal na dropzone |
hint | string | undefined | Texto secundário de instrução |
disabled | boolean | false | Desabilita o upload |
Dropzone
Click to upload or drag and drop
PNG, JPG or PDF — max 5 MB
Button