ValyroUI English version

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';

Пропсы

PropTypeDefault
valueFileItem[]File list, including rejected files (status error). Apps drive status/progress while uploading.
defaultValueFileItem[][]Initial value when uncontrolled.
onValueChange(items: FileItem[]) => voidCalled with the new value when it changes.
onFilesAdded(items: FileItem[]) => voidCalled with the newly accepted files — the place to start uploads.
acceptstringSame syntax as <input accept>: image/*,.pdf.
maxSizenumberMaximum size per file, in bytes.
maxFilesnumberMaximum number of accepted files; extra files are listed as rejected. Applies only with multiple.
multiplebooleantrueAllow several files; when false, a new pick replaces the current file.
disabledbooleanfalseDisables the drop zone, the file picker and the remove buttons.
invalidbooleanfalseDanger border on the drop zone (aria-invalid).
titleReactNodeDrop zone heading. Defaults to "Click to upload or drag and drop"; labels.drop replaces it while dragging.
hintReactNodeText under the title. Defaults to a summary of accept, maxSize and maxFiles.
localestringLocale for file sizes and progress. Defaults to the ThemeProvider locale, then the browser's.
labelsPartial<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 · Весь раздел «Формы и ввод»