Are you an LLM? You can read better optimized documentation at /components/file-drop-zone.md for this page in Markdown format
File Drop Zone โ
Stable
vue
<script setup lang="ts">
import { HFileDropZone } from '@holistics/design-system'
</script>
<template>
<HFileDropZone style="width: 400px" />
</template>Examples โ
Multiple Files โ
vue
<script setup lang="ts">
import { HFileDropZone } from '@holistics/design-system'
const multiple = 5
const title = 'Upload files (Max 5 files)'
</script>
<template>
<HFileDropZone
style="width: 400px"
:multiple
:title
/>
</template>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 โ
| Name | Type | Description |
|---|---|---|
fileIconย | "function" | "address-card" | "adls2" | "ai/chat-insights" | "ai/mascot-glasses-color" | "ai/monitor-hai-sparkle" | "ai-mascot-color" | "ai-mascot" | "airtable" | "align-center" | ... 459 more ...= "file-doc" | 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., {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept} |
sizeLimitย | number= 0 | Maximum file size (in bytes). Set to |
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 |
multipleย | number= 0 | Maximum number of files allowed. Set to |
Events โ
| Name | Parameters | Description |
|---|---|---|
@files | [files: File[]] |