Skip to content
UI

File Upload

A component that allows users to select and upload files through drag and drop or file browser.

<script setup lang="ts">
import { ref } from 'vue'
import { FileUpload } from '@destyler-ui/vue'

const testProps = ref<string[]>([])

// Create a mock image file for testing purposes (synchronously)
function createMockImageFile(): File {
  // Create a small 1x1 transparent PNG as a base64 data URL
  const base64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='
  const byteCharacters = atob(base64Data)
  const byteNumbers = new Array(byteCharacters.length)
  for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i)
  }
  const byteArray = new Uint8Array(byteNumbers)
  const blob = new Blob([byteArray], { type: 'image/png' })
  return new File([blob], 'test-image.png', { type: 'image/png' })
}

const mockImageFile = createMockImageFile()
</script>

<template>
  <FileUpload.Root v-model="testProps">
    <FileUpload.Dropzone>
      <FileUpload.Label>Drag your file(s) here</FileUpload.Label>
    </FileUpload.Dropzone>
    <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
    <FileUpload.ClearTrigger>Clear</FileUpload.ClearTrigger>
    <FileUpload.ItemGroup>
      <FileUpload.Context v-slot="api">
        <FileUpload.Item v-for="file in api.acceptedFiles" :key="file.name as string" :file="file">
          <FileUpload.ItemPreview>
            <FileUpload.ItemPreviewImage />
          </FileUpload.ItemPreview>
          <FileUpload.ItemName>{{ file.name }}</FileUpload.ItemName>
          <FileUpload.ItemSizeText>{{ api.getFileSize(file) }}</FileUpload.ItemSizeText>
          <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
        </FileUpload.Item>
      </FileUpload.Context>
      <!-- Static mock item for testing to ensure all parts are rendered -->
      <FileUpload.Item :file="mockImageFile">
        <FileUpload.ItemPreview>
          <FileUpload.ItemPreviewImage />
        </FileUpload.ItemPreview>
        <FileUpload.ItemName>{{ mockImageFile.name }}</FileUpload.ItemName>
        <FileUpload.ItemSizeText>1 KB</FileUpload.ItemSizeText>
        <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
      </FileUpload.Item>
    </FileUpload.ItemGroup>
    <FileUpload.HiddenInput />
  </FileUpload.Root>
</template>
import { useState } from 'react'
import { FileUpload } from '@destyler-ui/react'

// Create a mock image file for testing purposes (synchronously)
function createMockImageFile(): File {
  // Create a small 1x1 transparent PNG as a base64 data URL
  const base64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='
  const byteCharacters = atob(base64Data)
  const byteNumbers = Array.from({ length: byteCharacters.length })
  for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i)
  }
  const byteArray = new Uint8Array(byteNumbers)
  const blob = new Blob([byteArray], { type: 'image/png' })
  return new File([blob], 'test-image.png', { type: 'image/png' })
}

const mockImageFile = createMockImageFile()

export function Basic() {
  const [_files, setFiles] = useState<string[]>([])

  return (
    <FileUpload.Root onFileChange={details => setFiles(details.acceptedFiles.map(f => f.name))}>
      <FileUpload.Dropzone>
        <FileUpload.Label>Drag your file(s) here</FileUpload.Label>
      </FileUpload.Dropzone>
      <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
      <FileUpload.ClearTrigger>Clear</FileUpload.ClearTrigger>
      <FileUpload.ItemGroup>
        <FileUpload.Context>
          {api => (
            <>
              {api.acceptedFiles.map(file => (
                <FileUpload.Item key={file.name} file={file}>
                  <FileUpload.ItemPreview>
                    <FileUpload.ItemPreviewImage />
                  </FileUpload.ItemPreview>
                  <FileUpload.ItemName>{file.name}</FileUpload.ItemName>
                  <FileUpload.ItemSizeText>{api.getFileSize(file)}</FileUpload.ItemSizeText>
                  <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
                </FileUpload.Item>
              ))}
            </>
          )}
        </FileUpload.Context>
        {/* Static mock item for testing to ensure all parts are rendered */}
        <FileUpload.Item file={mockImageFile}>
          <FileUpload.ItemPreview>
            <FileUpload.ItemPreviewImage />
          </FileUpload.ItemPreview>
          <FileUpload.ItemName>{mockImageFile.name}</FileUpload.ItemName>
          <FileUpload.ItemSizeText>1 KB</FileUpload.ItemSizeText>
          <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
        </FileUpload.Item>
      </FileUpload.ItemGroup>
      <FileUpload.HiddenInput />
    </FileUpload.Root>
  )
}
import { FileUpload } from '@destyler-ui/solid/file-upload'
import { For } from 'solid-js'

export function Basic() {
  return (
    <FileUpload.Root maxFiles={5}>
      <FileUpload.Label>File Upload</FileUpload.Label>
      <FileUpload.Dropzone>Drag your file(s) here</FileUpload.Dropzone>
      <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
      <FileUpload.ItemGroup>
        <FileUpload.Context>
          {context => (
            <For each={context().acceptedFiles}>
              {file => (
                <FileUpload.Item file={file}>
                  <FileUpload.ItemPreview type="image/*">
                    <FileUpload.ItemPreviewImage />
                  </FileUpload.ItemPreview>
                  <FileUpload.ItemPreview type=".*">Any Icon</FileUpload.ItemPreview>
                  <FileUpload.ItemName />
                  <FileUpload.ItemSizeText />
                  <FileUpload.ItemDeleteTrigger>X</FileUpload.ItemDeleteTrigger>
                </FileUpload.Item>
              )}
            </For>
          )}
        </FileUpload.Context>
      </FileUpload.ItemGroup>
      <FileUpload.HiddenInput />
    </FileUpload.Root>
  )
}
<script lang="ts">
  import { FileUpload } from '@destyler-ui/svelte'

  function createMockImageFile(): File {
    const data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==')
    const bytes = Uint8Array.from(data, (character) => character.charCodeAt(0))
    return new File([bytes], 'test-image.png', { type: 'image/png' })
  }

  const mockImageFile = createMockImageFile()
</script>

<FileUpload.Root>
  <FileUpload.Dropzone>
    <FileUpload.Label>Drag your file(s) here</FileUpload.Label>
  </FileUpload.Dropzone>
  <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
  <FileUpload.ClearTrigger>Clear</FileUpload.ClearTrigger>
  <FileUpload.ItemGroup>
    <FileUpload.Context>
      {#snippet render(api)}
        {#each api().acceptedFiles as file (`${file.name}-${file.lastModified}`)}
          <FileUpload.Item {file}>
            <FileUpload.ItemPreview>
              <FileUpload.ItemPreviewImage />
            </FileUpload.ItemPreview>
            <FileUpload.ItemName>{file.name}</FileUpload.ItemName>
            <FileUpload.ItemSizeText>{api().getFileSize(file)}</FileUpload.ItemSizeText>
            <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
          </FileUpload.Item>
        {/each}
      {/snippet}
    </FileUpload.Context>
    <FileUpload.Item file={mockImageFile}>
      <FileUpload.ItemPreview>
        <FileUpload.ItemPreviewImage />
      </FileUpload.ItemPreview>
      <FileUpload.ItemName>{mockImageFile.name}</FileUpload.ItemName>
      <FileUpload.ItemSizeText>1 KB</FileUpload.ItemSizeText>
      <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
    </FileUpload.Item>
  </FileUpload.ItemGroup>
  <FileUpload.HiddenInput />
</FileUpload.Root>
<script setup lang="ts">
import { FileUpload } from '@destyler-ui/vue'
</script>
<template>
<FileUpload.Root>
<FileUpload.Label />
<FileUpload.Dropzone>
<FileUpload.Trigger />
</FileUpload.Dropzone>
<FileUpload.ItemGroup>
<FileUpload.Item>
<FileUpload.ItemPreview>
<FileUpload.ItemPreviewImage />
</FileUpload.ItemPreview>
<FileUpload.ItemName />
<FileUpload.ItemSizeText />
<FileUpload.ItemDeleteTrigger />
</FileUpload.Item>
</FileUpload.ItemGroup>
<FileUpload.ClearTrigger />
<FileUpload.HiddenInput />
</FileUpload.Root>
</template>
import { FileUpload } from '@destyler-ui/react'
export default function Basic() {
return (
<FileUpload.Root>
<FileUpload.Label />
<FileUpload.Dropzone>
<FileUpload.Trigger />
</FileUpload.Dropzone>
<FileUpload.ItemGroup>
<FileUpload.Item>
<FileUpload.ItemPreview>
<FileUpload.ItemPreviewImage />
</FileUpload.ItemPreview>
<FileUpload.ItemName />
<FileUpload.ItemSizeText />
<FileUpload.ItemDeleteTrigger />
</FileUpload.Item>
</FileUpload.ItemGroup>
<FileUpload.ClearTrigger />
<FileUpload.HiddenInput />
</FileUpload.Root>
)
}
import { FileUpload } from '@destyler-ui/solid'
import { For } from 'solid-js'
export default function Basic() {
return (
<FileUpload.Root>
<FileUpload.Label />
<FileUpload.Dropzone>
<FileUpload.Trigger />
</FileUpload.Dropzone>
<FileUpload.ItemGroup>
<FileUpload.Context>
{api => (
<For each={api().acceptedFiles}>
{file => (
<FileUpload.Item file={file}>
<FileUpload.ItemPreview type="image/*">
<FileUpload.ItemPreviewImage />
</FileUpload.ItemPreview>
<FileUpload.ItemName />
<FileUpload.ItemSizeText />
<FileUpload.ItemDeleteTrigger />
</FileUpload.Item>
)}
</For>
)}
</FileUpload.Context>
</FileUpload.ItemGroup>
<FileUpload.ClearTrigger />
<FileUpload.HiddenInput />
</FileUpload.Root>
)
}
<script lang="ts">
import { FileUpload } from '@destyler-ui/svelte'
</script>
<FileUpload.Root>
<FileUpload.Dropzone>
<FileUpload.Label>Drag your files here</FileUpload.Label>
</FileUpload.Dropzone>
<FileUpload.Trigger>Choose files</FileUpload.Trigger>
<FileUpload.ClearTrigger>Clear</FileUpload.ClearTrigger>
<FileUpload.ItemGroup>
<FileUpload.Context>
{#snippet render(api)}
{#each api().acceptedFiles as file (file.name)}
<FileUpload.Item {file}>
<FileUpload.ItemPreview>
<FileUpload.ItemPreviewImage />
</FileUpload.ItemPreview>
<FileUpload.ItemName>{file.name}</FileUpload.ItemName>
<FileUpload.ItemSizeText>{api().getFileSize(file)}</FileUpload.ItemSizeText>
<FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
</FileUpload.Item>
{/each}
{/snippet}
</FileUpload.Context>
</FileUpload.ItemGroup>
<FileUpload.HiddenInput />
</FileUpload.Root>
<script setup lang="ts">
import { ref } from 'vue'
import { FileUpload } from '@destyler-ui/vue'

const testProps = ref<string[]>([])

// Create a mock image file for testing purposes (synchronously)
function createMockImageFile(): File {
  // Create a small 1x1 transparent PNG as a base64 data URL
  const base64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='
  const byteCharacters = atob(base64Data)
  const byteNumbers = new Array(byteCharacters.length)
  for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i)
  }
  const byteArray = new Uint8Array(byteNumbers)
  const blob = new Blob([byteArray], { type: 'image/png' })
  return new File([blob], 'test-image.png', { type: 'image/png' })
}

const mockImageFile = createMockImageFile()
</script>

<template>
  <FileUpload.Root v-model="testProps">
    <FileUpload.Dropzone>
      <FileUpload.Label>Drag your file(s) here</FileUpload.Label>
    </FileUpload.Dropzone>
    <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
    <FileUpload.ClearTrigger>Clear</FileUpload.ClearTrigger>
    <FileUpload.ItemGroup>
      <FileUpload.Context v-slot="api">
        <FileUpload.Item v-for="file in api.acceptedFiles" :key="file.name as string" :file="file">
          <FileUpload.ItemPreview>
            <FileUpload.ItemPreviewImage />
          </FileUpload.ItemPreview>
          <FileUpload.ItemName>{{ file.name }}</FileUpload.ItemName>
          <FileUpload.ItemSizeText>{{ api.getFileSize(file) }}</FileUpload.ItemSizeText>
          <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
        </FileUpload.Item>
      </FileUpload.Context>
      <!-- Static mock item for testing to ensure all parts are rendered -->
      <FileUpload.Item :file="mockImageFile">
        <FileUpload.ItemPreview>
          <FileUpload.ItemPreviewImage />
        </FileUpload.ItemPreview>
        <FileUpload.ItemName>{{ mockImageFile.name }}</FileUpload.ItemName>
        <FileUpload.ItemSizeText>1 KB</FileUpload.ItemSizeText>
        <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
      </FileUpload.Item>
    </FileUpload.ItemGroup>
    <FileUpload.HiddenInput />
  </FileUpload.Root>
</template>
import { useState } from 'react'
import { FileUpload } from '@destyler-ui/react'

// Create a mock image file for testing purposes (synchronously)
function createMockImageFile(): File {
  // Create a small 1x1 transparent PNG as a base64 data URL
  const base64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='
  const byteCharacters = atob(base64Data)
  const byteNumbers = Array.from({ length: byteCharacters.length })
  for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i)
  }
  const byteArray = new Uint8Array(byteNumbers)
  const blob = new Blob([byteArray], { type: 'image/png' })
  return new File([blob], 'test-image.png', { type: 'image/png' })
}

const mockImageFile = createMockImageFile()

export function Basic() {
  const [_files, setFiles] = useState<string[]>([])

  return (
    <FileUpload.Root onFileChange={details => setFiles(details.acceptedFiles.map(f => f.name))}>
      <FileUpload.Dropzone>
        <FileUpload.Label>Drag your file(s) here</FileUpload.Label>
      </FileUpload.Dropzone>
      <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
      <FileUpload.ClearTrigger>Clear</FileUpload.ClearTrigger>
      <FileUpload.ItemGroup>
        <FileUpload.Context>
          {api => (
            <>
              {api.acceptedFiles.map(file => (
                <FileUpload.Item key={file.name} file={file}>
                  <FileUpload.ItemPreview>
                    <FileUpload.ItemPreviewImage />
                  </FileUpload.ItemPreview>
                  <FileUpload.ItemName>{file.name}</FileUpload.ItemName>
                  <FileUpload.ItemSizeText>{api.getFileSize(file)}</FileUpload.ItemSizeText>
                  <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
                </FileUpload.Item>
              ))}
            </>
          )}
        </FileUpload.Context>
        {/* Static mock item for testing to ensure all parts are rendered */}
        <FileUpload.Item file={mockImageFile}>
          <FileUpload.ItemPreview>
            <FileUpload.ItemPreviewImage />
          </FileUpload.ItemPreview>
          <FileUpload.ItemName>{mockImageFile.name}</FileUpload.ItemName>
          <FileUpload.ItemSizeText>1 KB</FileUpload.ItemSizeText>
          <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
        </FileUpload.Item>
      </FileUpload.ItemGroup>
      <FileUpload.HiddenInput />
    </FileUpload.Root>
  )
}
import { FileUpload } from '@destyler-ui/solid/file-upload'
import { For } from 'solid-js'

export function Basic() {
  return (
    <FileUpload.Root maxFiles={5}>
      <FileUpload.Label>File Upload</FileUpload.Label>
      <FileUpload.Dropzone>Drag your file(s) here</FileUpload.Dropzone>
      <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
      <FileUpload.ItemGroup>
        <FileUpload.Context>
          {context => (
            <For each={context().acceptedFiles}>
              {file => (
                <FileUpload.Item file={file}>
                  <FileUpload.ItemPreview type="image/*">
                    <FileUpload.ItemPreviewImage />
                  </FileUpload.ItemPreview>
                  <FileUpload.ItemPreview type=".*">Any Icon</FileUpload.ItemPreview>
                  <FileUpload.ItemName />
                  <FileUpload.ItemSizeText />
                  <FileUpload.ItemDeleteTrigger>X</FileUpload.ItemDeleteTrigger>
                </FileUpload.Item>
              )}
            </For>
          )}
        </FileUpload.Context>
      </FileUpload.ItemGroup>
      <FileUpload.HiddenInput />
    </FileUpload.Root>
  )
}
<script lang="ts">
  import { FileUpload } from '@destyler-ui/svelte'

  function createMockImageFile(): File {
    const data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==')
    const bytes = Uint8Array.from(data, (character) => character.charCodeAt(0))
    return new File([bytes], 'test-image.png', { type: 'image/png' })
  }

  const mockImageFile = createMockImageFile()
</script>

<FileUpload.Root>
  <FileUpload.Dropzone>
    <FileUpload.Label>Drag your file(s) here</FileUpload.Label>
  </FileUpload.Dropzone>
  <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
  <FileUpload.ClearTrigger>Clear</FileUpload.ClearTrigger>
  <FileUpload.ItemGroup>
    <FileUpload.Context>
      {#snippet render(api)}
        {#each api().acceptedFiles as file (`${file.name}-${file.lastModified}`)}
          <FileUpload.Item {file}>
            <FileUpload.ItemPreview>
              <FileUpload.ItemPreviewImage />
            </FileUpload.ItemPreview>
            <FileUpload.ItemName>{file.name}</FileUpload.ItemName>
            <FileUpload.ItemSizeText>{api().getFileSize(file)}</FileUpload.ItemSizeText>
            <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
          </FileUpload.Item>
        {/each}
      {/snippet}
    </FileUpload.Context>
    <FileUpload.Item file={mockImageFile}>
      <FileUpload.ItemPreview>
        <FileUpload.ItemPreviewImage />
      </FileUpload.ItemPreview>
      <FileUpload.ItemName>{mockImageFile.name}</FileUpload.ItemName>
      <FileUpload.ItemSizeText>1 KB</FileUpload.ItemSizeText>
      <FileUpload.ItemDeleteTrigger>Remove</FileUpload.ItemDeleteTrigger>
    </FileUpload.Item>
  </FileUpload.ItemGroup>
  <FileUpload.HiddenInput />
</FileUpload.Root>

Combine file upload with a form field for validation and labeling.

<script setup lang="ts">
import { FileUpload } from '@destyler-ui/vue'
import { Field } from '@destyler-ui/vue'
</script>

<template>
  <Field.Root>
    <FileUpload.Root :maxFiles="5">
      <FileUpload.Label>Label</FileUpload.Label>
      <FileUpload.Trigger>Select</FileUpload.Trigger>
      <FileUpload.ItemGroup />
      <FileUpload.HiddenInput data-testid="input" />
    </FileUpload.Root>
    <Field.HelperText>Additional Info</Field.HelperText>
    <Field.ErrorText>Error Info</Field.ErrorText>
  </Field.Root>
</template>
import { Field } from '@destyler-ui/react'
import { FileUpload } from '@destyler-ui/react'

export function WithField() {
  return (
    <Field.Root>
      <FileUpload.Root maxFiles={5}>
        <FileUpload.Label>Label</FileUpload.Label>
        <FileUpload.Trigger>Select</FileUpload.Trigger>
        <FileUpload.ItemGroup />
        <FileUpload.HiddenInput data-testid="input" />
      </FileUpload.Root>
      <Field.HelperText>Additional Info</Field.HelperText>
      <Field.ErrorText>Error Info</Field.ErrorText>
    </Field.Root>
  )
}
import { Field } from '@destyler-ui/solid/field'
import { FileUpload } from '@destyler-ui/solid/file-upload'

export function WithField(props: Field.RootProps) {
  return (
    <Field.Root {...props}>
      <FileUpload.Root maxFiles={5}>
        <FileUpload.Label>Label</FileUpload.Label>
        <FileUpload.Trigger>Select</FileUpload.Trigger>
        <FileUpload.ItemGroup />
        <FileUpload.HiddenInput data-testid="input" />
      </FileUpload.Root>
      <Field.HelperText>Additional Info</Field.HelperText>
      <Field.ErrorText>Error Info</Field.ErrorText>
    </Field.Root>
  )
}
<script module lang="ts">
  import type { FieldRootProps } from '@destyler-ui/svelte'

  export interface WithFieldProps extends FieldRootProps {}
</script>

<script lang="ts">
  import { Field } from '@destyler-ui/svelte'
  import { FileUpload } from '@destyler-ui/svelte'

  const props: WithFieldProps = $props()
</script>

<Field.Root {...props}>
  <FileUpload.Root maxFiles={5}>
    <FileUpload.Label>Label</FileUpload.Label>
    <FileUpload.Trigger>Select</FileUpload.Trigger>
    <FileUpload.ItemGroup />
    <FileUpload.HiddenInput data-testid="input" />
  </FileUpload.Root>
  <Field.HelperText>Additional Info</Field.HelperText>
  <Field.ErrorText>Error Info</Field.ErrorText>
</Field.Root>
<script setup lang="ts">
import { FileUpload, useFileUpload } from '@destyler-ui/vue'

const fileUpload = useFileUpload({ maxFiles: 5 })
</script>

<template>
  <button @click="fileUpload.clearFiles()">Clear</button>

  <FileUpload.RootProvider :value="fileUpload">
    <FileUpload.Label>File Upload</FileUpload.Label>
    <FileUpload.Dropzone>Drop your files here</FileUpload.Dropzone>
    <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
    <FileUpload.ItemGroup>
      <FileUpload.Context v-slot="{ acceptedFiles }">
        <FileUpload.Item v-for="file in acceptedFiles" :file="file" :key="file.name">
          <FileUpload.ItemPreview type="image/*">
            <FileUpload.ItemPreviewImage />
          </FileUpload.ItemPreview>
          <FileUpload.ItemPreview type=".*">
            <div>Generic Icon</div>
          </FileUpload.ItemPreview>
          <FileUpload.ItemName />
          <FileUpload.ItemSizeText />
          <FileUpload.ItemDeleteTrigger>X</FileUpload.ItemDeleteTrigger>
        </FileUpload.Item>
      </FileUpload.Context>
    </FileUpload.ItemGroup>
    <FileUpload.HiddenInput />
  </FileUpload.RootProvider>
</template>
import { FileUpload, useFileUpload } from '@destyler-ui/react'

export function RootProvider() {
  const fileUpload = useFileUpload({ maxFiles: 5 })

  return (
    <>
      <button onClick={() => fileUpload.clearFiles()}>Clear</button>

      <FileUpload.RootProvider value={fileUpload}>
        <FileUpload.Label>File Upload</FileUpload.Label>
        <FileUpload.Dropzone>Drop your files here</FileUpload.Dropzone>
        <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
        <FileUpload.ItemGroup>
          <FileUpload.Context>
            {api => (
              <>
                {api.acceptedFiles.map(file => (
                  <FileUpload.Item key={file.name} file={file}>
                    <FileUpload.ItemPreview type="image/*">
                      <FileUpload.ItemPreviewImage />
                    </FileUpload.ItemPreview>
                    <FileUpload.ItemPreview type=".*">
                      <div>Generic Icon</div>
                    </FileUpload.ItemPreview>
                    <FileUpload.ItemName />
                    <FileUpload.ItemSizeText />
                    <FileUpload.ItemDeleteTrigger>X</FileUpload.ItemDeleteTrigger>
                  </FileUpload.Item>
                ))}
              </>
            )}
          </FileUpload.Context>
        </FileUpload.ItemGroup>
        <FileUpload.HiddenInput />
      </FileUpload.RootProvider>
    </>
  )
}
import { FileUpload, useFileUpload } from '@destyler-ui/solid/file-upload'
import { For } from 'solid-js'

export function RootProvider() {
  const fileUpload = useFileUpload({ maxFiles: 5 })

  return (
    <>
      <button onClick={() => fileUpload().clearFiles()}>Clear</button>

      <FileUpload.RootProvider value={fileUpload}>
        <FileUpload.Label>File Upload</FileUpload.Label>
        <FileUpload.Dropzone>Drag your file(s)here</FileUpload.Dropzone>
        <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
        <FileUpload.ItemGroup>
          <FileUpload.Context>
            {context => (
              <For each={context().acceptedFiles}>
                {file => (
                  <FileUpload.Item file={file}>
                    <FileUpload.ItemPreview type="image/*">
                      <FileUpload.ItemPreviewImage />
                    </FileUpload.ItemPreview>
                    <FileUpload.ItemPreview type=".*">Any Icon</FileUpload.ItemPreview>
                    <FileUpload.ItemName />
                    <FileUpload.ItemSizeText />
                    <FileUpload.ItemDeleteTrigger>X</FileUpload.ItemDeleteTrigger>
                  </FileUpload.Item>
                )}
              </For>
            )}
          </FileUpload.Context>
        </FileUpload.ItemGroup>
        <FileUpload.HiddenInput />
      </FileUpload.RootProvider>
    </>
  )
}
<script lang="ts">
  import { FileUpload, useFileUpload } from '@destyler-ui/svelte'

  const id = $props.id()
  const fileUpload = useFileUpload({ id, maxFiles: 5 })
</script>

<button type="button" onclick={() => fileUpload().clearFiles()}>Clear</button>

<FileUpload.RootProvider value={fileUpload}>
  <FileUpload.Label>File Upload</FileUpload.Label>
  <FileUpload.Dropzone>Drop your files here</FileUpload.Dropzone>
  <FileUpload.Trigger>Choose file(s)</FileUpload.Trigger>
  <FileUpload.ItemGroup>
    <FileUpload.Context>
      {#snippet render(api)}
        {#each api().acceptedFiles as file (`${file.name}-${file.lastModified}`)}
          <FileUpload.Item {file}>
            <FileUpload.ItemPreview type="image/*">
              <FileUpload.ItemPreviewImage />
            </FileUpload.ItemPreview>
            <FileUpload.ItemPreview type=".*"><div>Generic Icon</div></FileUpload.ItemPreview>
            <FileUpload.ItemName />
            <FileUpload.ItemSizeText />
            <FileUpload.ItemDeleteTrigger>X</FileUpload.ItemDeleteTrigger>
          </FileUpload.Item>
        {/each}
      {/snippet}
    </FileUpload.Context>
  </FileUpload.ItemGroup>
  <FileUpload.HiddenInput />
</FileUpload.RootProvider>

Root

PropDefaultType
acceptRecord<string, string[]> | "image/png" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/webp" | "image/avif" | "image/heic" | "image/bmp" | "application/pdf" | "application/zip" | "application/json" | "application/xml" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/rtf" | "application/x-rar" | "application/x-7z-compressed" | "application/x-tar" | "application/vnd.microsoft.portable-executable" | "text/css" | "text/csv" | "text/html" | "text/markdown" | "text/plain" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "font/eot" | "font/svg" | "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "audio/flac" | "audio/x-m4a" | "image/*" | "audio/*" | "video/*" | "text/*" | "application/*" | "font/*" | (string & {}) | fileUpload.FileMimeType[]

The accept file types

allowDroptruefalse | true

Whether to allow drag and drop in the dropzone element

asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

capture"user" | "environment"

The default camera to use when capturing media

directoryfalse | true

Whether to accept directories, only works in webkit browsers

disabledfalse | true

Whether the file input is disabled

idstring

The unique identifier of the machine.

idsPartial<{ root: string; dropzone: string; hiddenInput: string; trigger: string; label: string; item: (id: string) => string; itemName: (id: string) => string; itemSizeText: (id: string) => string; itemPreview: (id: string) => string; }>

The ids of the elements. Useful for composition.

invalidfalse | true

Whether the file input is invalid

locale"en-US"string

The current locale. Based on the BCP 47 definition.

maxFiles1number

The maximum number of files

maxFileSizeInfinitynumber

The maximum file size in bytes

minFileSize0number

The minimum file size in bytes

namestring

The name of the underlying file input

preventDocumentDroptruefalse | true

Whether to prevent the drop event on the document

requiredfalse | true

Whether the file input is required

translationsfileUpload.IntlTranslations

The localized messages to use.

validate(file: File, details: fileUpload.FileValidateDetails) => fileUpload.FileError[] | null

Function to validate a file

EmitEvent
fileAccept[details: FileAcceptDetails]

Function called when the file is accepted

fileChange[details: FileChangeDetails]

Function called when the value changes, whether accepted or rejected

fileReject[details: FileRejectDetails]

Function called when the file is rejected

ClearTrigger

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Context

No serializable props or emits are declared for this part.

Dropzone

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

disableClickfalse | true

Whether to disable the click event on the dropzone

HiddenInput

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Item

PropDefaultType
file*File
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemDeleteTrigger

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemGroup

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemName

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemPreview

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

type'.*'string

The file type to match against. Matches all file types by default.

ItemPreviewImage

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemSizeText

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Label

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

RootProvider

PropDefaultType
value*MachineApi<PropTypes>
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Trigger

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Root

PropDefaultType
acceptRecord<string, string[]> | "image/png" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/webp" | "image/avif" | "image/heic" | "image/bmp" | "application/pdf" | "application/zip" | "application/json" | "application/xml" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/rtf" | "application/x-rar" | "application/x-7z-compressed" | "application/x-tar" | "application/vnd.microsoft.portable-executable" | "text/css" | "text/csv" | "text/html" | "text/markdown" | "text/plain" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "font/eot" | "font/svg" | "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "audio/flac" | "audio/x-m4a" | "image/*" | "audio/*" | "video/*" | "text/*" | "application/*" | "font/*" | (string & {}) | fileUpload.FileMimeType[]

The accept file types

allowDroptruefalse | true

Whether to allow drag and drop in the dropzone element

asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

capture"user" | "environment"

The default camera to use when capturing media

directoryfalse | true

Whether to accept directories, only works in webkit browsers

disabledfalse | true

Whether the file input is disabled

idsPartial<{ root: string; dropzone: string; hiddenInput: string; trigger: string; label: string; item: (id: string) => string; itemName: (id: string) => string; itemSizeText: (id: string) => string; itemPreview: (id: string) => string; }>

The ids of the elements. Useful for composition.

invalidfalse | true

Whether the file input is invalid

locale"en-US"string

The current locale. Based on the BCP 47 definition.

maxFiles1number

The maximum number of files

maxFileSizeInfinitynumber

The maximum file size in bytes

minFileSize0number

The minimum file size in bytes

namestring

The name of the underlying file input

onFileAccept(details: FileAcceptDetails) => void

Function called when the file is accepted

onFileChange(details: FileChangeDetails) => void

Function called when the value changes, whether accepted or rejected

onFileReject(details: FileRejectDetails) => void

Function called when the file is rejected

preventDocumentDroptruefalse | true

Whether to prevent the drop event on the document

requiredfalse | true

Whether the file input is required

translationsfileUpload.IntlTranslations

The localized messages to use.

validate(file: File, details: fileUpload.FileValidateDetails) => fileUpload.FileError[] | null

Function to validate a file

ClearTrigger

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Context

PropDefaultType
children*(context: UseFileUploadContext) => ReactNode

Dropzone

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

disableClickfalse | true

Whether to disable the click event on the dropzone

HiddenInput

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Item

PropDefaultType
file*File
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemDeleteTrigger

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemGroup

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemName

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemPreview

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

type'.*'string

The file type to match against. Matches all file types by default.

ItemPreviewImage

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

ItemSizeText

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Label

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

RootProvider

PropDefaultType
value*UseFileUploadReturn
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Trigger

PropDefaultType
asChildfalse | true

Use the provided child element as the default rendered element, combining their props and behavior.

Root

PropDefaultType
accept(string & {}) | Record<string, string[]> | "image/png" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/webp" | "image/avif" | "image/heic" | "image/bmp" | "application/pdf" | "application/zip" | "application/json" | "application/xml" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/rtf" | "application/x-rar" | "application/x-7z-compressed" | "application/x-tar" | "application/vnd.microsoft.portable-executable" | "text/css" | "text/csv" | "text/html" | "text/markdown" | "text/plain" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "font/eot" | "font/svg" | "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "audio/flac" | "audio/x-m4a" | "image/*" | "audio/*" | "video/*" | "text/*" | "application/*" | "font/*" | fileUpload.FileMimeType[]

The accept file types

allowDroptruefalse | true

Whether to allow drag and drop in the dropzone element

asChild(props: (userProps?: solid_js62.JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

capture"user" | "environment"

The default camera to use when capturing media

directoryfalse | true

Whether to accept directories, only works in webkit browsers

disabledfalse | true

Whether the file input is disabled

idsPartial<{ root: string; dropzone: string; hiddenInput: string; trigger: string; label: string; item: (id: string) => string; itemName: (id: string) => string; itemSizeText: (id: string) => string; itemPreview: (id: string) => string; }>

The ids of the elements. Useful for composition.

invalidfalse | true

Whether the file input is invalid

locale"en-US"string

The current locale. Based on the BCP 47 definition.

maxFiles1number

The maximum number of files

maxFileSizeInfinitynumber

The maximum file size in bytes

minFileSize0number

The minimum file size in bytes

namestring

The name of the underlying file input

onFileAccept(details: FileAcceptDetails) => void

Function called when the file is accepted

onFileChange(details: FileChangeDetails) => void

Function called when the value changes, whether accepted or rejected

onFileReject(details: FileRejectDetails) => void

Function called when the file is rejected

preventDocumentDroptruefalse | true

Whether to prevent the drop event on the document

requiredfalse | true

Whether the file input is required

translationsfileUpload.IntlTranslations

The localized messages to use.

validate(file: File, details: FileValidateDetails) => fileUpload.FileError[] | null

Function to validate a file

ClearTrigger

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.ButtonHTMLAttributes<HTMLButtonElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

Context

PropDefaultType
children*(context: UseFileUploadContext) => Element

Dropzone

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

disableClickfalse | true

Whether to disable the click event on the dropzone

HiddenInput

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.InputHTMLAttributes<HTMLInputElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

Item

PropDefaultType
file*File
asChild(props: (userProps?: solid_js62.JSX.LiHTMLAttributes<HTMLLIElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

ItemDeleteTrigger

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.ButtonHTMLAttributes<HTMLButtonElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

ItemGroup

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.HTMLAttributes<HTMLUListElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

ItemName

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

ItemPreview

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

type'.*'string

The file type to match against. Matches all file types by default.

ItemPreviewImage

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.ImgHTMLAttributes<HTMLImageElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

ItemSizeText

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

Label

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.LabelHTMLAttributes<HTMLLabelElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

RootProvider

PropDefaultType
value*UseFileUploadReturn
asChild(props: (userProps?: solid_js62.JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

Trigger

PropDefaultType
asChild(props: (userProps?: solid_js62.JSX.ButtonHTMLAttributes<HTMLButtonElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

Root

PropDefaultType
acceptRecord<string, string[]> | FileMimeType | FileMimeType[] | undefined

The accept file types

allowDroptruefalse | true

Whether to allow drag and drop in the dropzone element

asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"div">]>
capture"user" | "environment"

The default camera to use when capturing media

childrenSnippet<[]> | undefined
directoryfalse | true

Whether to accept directories, only works in webkit browsers

disabledfalse | true

Whether the file input is disabled

idstring
idsPartial<{ root: string; dropzone: string; hiddenInput: string; trigger: string; label: string; item: (id: string) => string; itemName: (id: string) => string; itemSizeText: (id: string) => string; itemPreview: (id: string) => string; }>

The ids of the elements. Useful for composition.

invalidfalse | true

Whether the file input is invalid

locale"en-US"string

The current locale. Based on the BCP 47 definition.

maxFiles1number

The maximum number of files

maxFileSizeInfinitynumber

The maximum file size in bytes

minFileSize0number

The minimum file size in bytes

namestring

The name of the underlying file input

onFileAccept(details: import("/home/runner/work/ui/ui/packages/svelte/dist/index").FileUploadFileAcceptDetails) => void

Function called when the file is accepted

onFileChange(details: import("/home/runner/work/ui/ui/packages/svelte/dist/index").FileUploadFileChangeDetails) => void

Function called when the value changes, whether accepted or rejected

onFileReject(details: import("/home/runner/work/ui/ui/packages/svelte/dist/index").FileUploadFileRejectDetails) => void

Function called when the file is rejected

preventDocumentDroptruefalse | true

Whether to prevent the drop event on the document

requiredfalse | true

Whether the file input is required

translationsIntlTranslations | undefined

The localized messages to use.

validate((file: File, details: FileValidateDetails) => FileError[] | null) | undefined

Function to validate a file

ClearTrigger

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"button">]>
childrenSnippet<[]> | undefined

Context

PropDefaultType
renderSnippet<[UseFileUploadContext]>

Dropzone

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"div">]>
childrenSnippet<[]> | undefined
disableClickfalse | true

Whether to disable the click event on the dropzone

HiddenInput

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"input">]>
childrenSnippet<[]> | undefined

Item

PropDefaultType
file*File
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"li">]>
childrenSnippet<[]> | undefined

ItemDeleteTrigger

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"button">]>
childrenSnippet<[]> | undefined

ItemGroup

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"ul">]>
childrenSnippet<[]> | undefined

ItemName

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"div">]>
childrenSnippet<[]> | undefined

ItemPreview

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"div">]>
childrenSnippet<[]> | undefined
typestring

The file type to match against. Matches all file types by default.

ItemPreviewImage

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"img">]>
childrenSnippet<[]> | undefined

ItemSizeText

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"div">]>
childrenSnippet<[]> | undefined

Label

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"label">]>
childrenSnippet<[]> | undefined

RootProvider

PropDefaultType
value*UseFileUploadReturn
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"div">]>
childrenSnippet<[]> | undefined

Trigger

PropDefaultType
asChildimport("svelte").Snippet<[import("/home/runner/work/ui/ui/packages/svelte/dist/types").PropsFn<"button">]>
childrenSnippet<[]> | undefined