FileDrop

Files, dropped on or chosen from a real file input.

Import it from rei-kit: import { FileDrop } from 'rei-kit'

Open FileDrop in the live documentation, where every prop below is a control you can change, in four materials and ten palettes.

Usage

<script setup lang="ts">
import { ref } from 'vue'
import { FileDrop } from 'rei-kit'

const files = ref<File[]>([])
</script>

<template>
  <FileDrop
    v-model="files"
    label="Drop a receipt here"
    hint="PDF or an image, up to 5 MB"
    browse-label="Browse"
    remove-label="Remove"
    too-large-label="That file is over 5 MB"
    accept="image/*,.pdf"
    :max-size="5 * 1024 * 1024"
    multiple
  />
</template>

Props

Props
PropTypeRequired or defaultWhat it is for
labelstringyesThe instruction in the box: "Drop a receipt here". Already translated.
hintstring''A line under it: what is accepted, how big.
browseLabelstringyesThe button inside the box, e.g. "Browse".
removeLabelstringyesAccessible name of each file's remove button.
acceptstringundefinedPassed to the input: `image/*`, `.pdf`.
multiplebooleanfalse
maxSizenumberundefinedIn bytes. Anything larger is refused and reported through `rejected`.
tooLargeLabelstringundefinedShown under the box when a file was too large.
disabledbooleanfalse

About rei-kit

rei-kit is an accessible Vue 3 and Tailwind CSS 4 component library: 106 components, themed by role rather than by colour on three independent axes — ten WCAG-checked palettes, four materials and light or dark, each switched with one attribute. Typed, tested, SSR-safe, no runtime dependencies, MIT.

pnpm add rei-kit · npm · GitHub