Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { FileUpload } from '@dryui/ui';
</script>

<FileUpload.Root>
  <FileUpload.Dropzone>...</FileUpload.Dropzone>
  <FileUpload.Trigger>...</FileUpload.Trigger>
  <FileUpload.List>...</FileUpload.List>
  <FileUpload.Item>...</FileUpload.Item>
  <FileUpload.ItemDelete>...</FileUpload.ItemDelete>
</FileUpload.Root>

Import options

Root package

ts
import { FileUpload } from '@dryui/ui'

Per-component subpath

ts
import { FileUpload } from '@dryui/ui/file-upload'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Dropzone

Drop files here or click to upload
svelte
<FileUpload.Root>
  <FileUpload.Dropzone>
    Drop files here or click to upload
  </FileUpload.Dropzone>
</FileUpload.Root>

With File List

Drop images here
svelte
<FileUpload.Root multiple accept="image/*">
  <FileUpload.Dropzone>
    Drop images here
  </FileUpload.Dropzone>
  <FileUpload.List>
    {#snippet children({ file, index })}
      <FileUpload.Item {file} {index}>
        {file.name}
        <FileUpload.ItemDelete {index} />
      </FileUpload.Item>
    {/snippet}
  </FileUpload.List>
</FileUpload.Root>

Button Trigger

svelte
<FileUpload.Root>
  <FileUpload.Trigger>
    <Button variant="outline">Choose File</Button>
  </FileUpload.Trigger>
</FileUpload.Root>

Structure

Compound components always start with FileUpload.Root. Use this structure block to understand required wrappers before you wire state or styling.

FileUpload.Root
  FileUpload.Dropzone
  FileUpload.Trigger
  FileUpload.List
  FileUpload.Item
  FileUpload.ItemDelete
FileUpload.Root FileUpload.DropzoneFileUpload.TriggerFileUpload.ListFileUpload.ItemFileUpload.ItemDelete

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Compound component. Start with FileUpload.Root, then add only the parts you need.

FileUpload.DropzoneFileUpload.TriggerFileUpload.ListFileUpload.ItemFileUpload.ItemDelete

FileUpload.Root

Prop Type Default Required Bindable
files
File[]
[]
accept
string
multiple
boolean
maxSize
number
maxFiles
number
disabled
boolean
onFilesChange
(files: File[]) => void
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

FileUpload.Dropzone

Prop Type Default Required Bindable
size
smmdlg
'md'
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

FileUpload.Trigger

Prop Type Default Required Bindable
size
smmdlg
'md'
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name.

FileUpload.List

Prop Type Default Required Bindable
size
smmdlg
'md'
children
Snippet<[{ file: File; index: number }]>

Forwards <ul> attributes via rest props. Common examples: id, style, aria-labelledby. Omitted: children.

FileUpload.Item

Prop Type Default Required Bindable
file
File
index
number
size
smmdlg
'md'
children
Snippet

Forwards <li> attributes via rest props. Common examples: id, role, value.

FileUpload.ItemDelete

Prop Type Default Required Bindable
index
number
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name.