Skip to content

File Drop Zone โ€‹

Stable
vue
<script setup lang="ts">
import { HFileDropZone } from '@holistics/design-system'

</script>
<template>
  <HFileDropZone style="width: 400px" />
</template>

Examples โ€‹

Size Limit โ€‹

vue
<script setup lang="ts">
import { HFileDropZone } from '@holistics/design-system'

const sizeLimit = 5 * 1024 * 1024 // 5MB
const title = 'Upload file (Max 5MB)'

</script>
<template>
  <HFileDropZone
    style="width: 400px"
    :size-limit
    :title
  />
</template>

Restricted File Types โ€‹

vue
<script setup lang="ts">
import { HFileDropZone } from '@holistics/design-system'

const accept = 'image/png,image/jpeg'
const title = 'Upload images only'
const fileIcon = 'file/image'

</script>
<template>
  <HFileDropZone
    style="width: 400px"
    :accept
    :title
    :file-icon
  />
</template>

API โ€‹

Pass-through: <div> โ€‹

What does this mean?

All props, events, and attrs that are not specified in the tables below will be passed to the element/component described above.

Props โ€‹

NameTypeDescription
fileIconย 
"function" | "cancel" | "copy" | "cut" | "error" | "pause" | "play" | "add-block" | "add-circle" | "add-filter" | "add-tag" | "add" | "address-card" | "adhoc-query" | "ai/file" | ... 448 more ...
= "file/document"

Icon displayed in the drop zone area.

acceptย 
string
= "*"

A comma-separated list of one or more file types in MIME type format (e.g., 'image/*', '.pdf', or '*' for all types), describing which file types to allow.

{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept}

sizeLimitย 
number
= 0

Maximum file size (in bytes). Set to 0 for no limit.

titleย 
string
= "Select a file to upload"

Main headline or callโ€‘toโ€‘action shown in the drop zone.

subtitleย 
string
= "or drag and drop here"

Secondary descriptive text shown below the title in the drop zone.

heightย 
number
= 384

Height (in px) of the drop zone when no file is dropped/selected.

Events โ€‹

NameParametersDescription
@file
[file: File | undefined]