File Uploader
Загрузка файлов. Бесплатно, MIT · Формы и ввод › Файлы и изображения
Установка
npx valyro-cli@latest add file-uploader
npx shadcn@latest add https://valyro.xyz/r/file-uploader.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { FileUploader } from 'valyro-ui';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
value | FileItem[] | File list, including rejected files (status error). Apps drive status/progress while uploading. | |
defaultValue | FileItem[] | [] | Initial value when uncontrolled. |
onValueChange | (items: FileItem[]) => void | Called with the new value when it changes. | |
onFilesAdded | (items: FileItem[]) => void | Called with the newly accepted files — the place to start uploads. | |
accept | string | Same syntax as <input accept>: image/*,.pdf. | |
maxSize | number | Maximum size per file, in bytes. | |
maxFiles | number | Maximum number of accepted files; extra files are listed as rejected. Applies only with multiple. | |
multiple | boolean | true | Allow several files; when false, a new pick replaces the current file. |
disabled | boolean | false | Disables the drop zone, the file picker and the remove buttons. |
invalid | boolean | false | Danger border on the drop zone (aria-invalid). |
title | ReactNode | Drop zone heading. Defaults to "Click to upload or drag and drop"; labels.drop replaces it while dragging. | |
hint | ReactNode | Text under the title. Defaults to a summary of accept, maxSize and maxFiles. | |
locale | string | Locale for file sizes and progress. Defaults to the ThemeProvider locale, then the browser's. | |
labels | Partial<FileUploaderLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- Image Cropper — Кадрирование: сдвиг, масштаб, поворот, пропорции и круглый аватар
- Text Input — Текстовые поля
- Textarea — Многострочный ввод
- Search Input — Поисковая строка
- Mentions Input — Текст с @упоминаниями и #тегами, асинхронные подсказки
- Tags Input — Ввод тегов
- Select — Выбор из списка
- Multi Select — Множественный выбор
- Combobox — Поиск и выбор
- Listbox — Список вариантов на странице: один или несколько, диапазоны с Shift
- Chip Group — Группа чипов с иконками: один или несколько вариантов
- Checkbox Tree — Дерево с чекбоксами: каскад, частичная отметка, клавиатура
Назад: Emoji Picker · Далее: Image Cropper · Весь раздел «Формы и ввод»