1. framework components
  2. file upload

File Upload

File upload dropzone and input patterns for selecting files.

Select file or drag here.

Disabled

Set the disabled prop to enable the disabled state.

Button Only

Replace the interface with a simple “browse” button.

Direction

Set the text direction (ltr or rtl) using the dir prop.

Anatomy

Here’s an overview of how the FileUpload component is structured in code:

svelte
<script lang="ts">
	import { FileUpload } from '@skeletonlabs/skeleton-svelte';
</script>

<FileUpload>
	<FileUpload.Dropzone>
		<FileUpload.Trigger />
		<FileUpload.HiddenInput />
	</FileUpload.Dropzone>
	<FileUpload.ItemGroup>
		<FileUpload.Item>
			<FileUpload.ItemName />
			<FileUpload.ItemSizeText />
			<FileUpload.ItemDeleteTrigger />
		</FileUpload.Item>
	</FileUpload.ItemGroup>
	<FileUpload.ClearTrigger />
</FileUpload>

API Reference

Unable to load component information for svelte/file-upload

View page on GitHub