component

Input Upload

props · 60 shown · 60 total

InputUpload

Content

  • InputUploadLabels

    Every user-facing string: the `title` headline, the fallback `trigger` text and each rejection message (`tooLarge`, `wrongType`, `tooMany`, `minWidth`, `maxWidth`, `minHeight`, `maxHeight`, `aspectRatio`). Messages with values take a function or a `{placeholder}` template (`"Arquivo maior que {max}"`). Unset keys keep the English defaults; an explicit `title` / `trigger` prop wins over `labels.title` / `labels.trigger`. In Astro only template strings survive to the client.

  • string

    BCP 47 locale for the file sizes interpolated into rejection messages (`{max}`, `{size}`), formatted with `Intl.NumberFormat` (`"pt-BR"` → `"1,5 kB"`). Omitted, sizes keep the English form (`"1.5 KB"`).

State

  • entries svelte
    UploadEntry[]

    Bindable mirror of the upload entries — every picked, uploading, stored or rejected file (engine → out only; use the engine API to change them).

  • UploadEntryInit[]

    Seed entries — files already stored elsewhere (`{ name, url, size }`). Read once, at creation.

Appearance

  • "transparent" "surface.peak" "surface.hill" "surface.base" "surface.valley" "surface.ground"
    default "transparent"

    Surface background variant.

  • "inherit" "lg" "md" "sm" "xs" "2xl" "xl" "inner" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Corner radius override. Without it the dropzone keeps its default `lg` corner. `inner` renders a concentric corner computed from the nearest parent panel (parent radius − parent padding, floored at `2xs`).

  • "lg" "md" "sm" "xs"
    default "md"

    Size variant. Scales the dropzone's min-height, padding, icon, and typography together.

  • "inherit" "cyan" "danger" "dynamic" "mauve" "neutral" "pink" "primary" "sage" "slate" "stone" "success" "teal" "violet" "warning"
    default "neutral"

    Semantic tone color scheme indicating validation state or context (for example, a red dropzone after rejecting an oversized file).

Layout

  • boolean
    default true

    Stretch the dropzone to fill its container width.

  • "inline" "stack" "tile" "avatar"
    default "stack"

    Dropzone layout: - `stack` — the classic centered dropzone. - `inline` — a compact single row as tall as an Input of the same `size`. - `tile` — a square that fills a grid cell (put it in an `UploadList` grid's `append` slot to get a gallery "add" tile). - `avatar` — a single-image picker that shows the current image, its upload progress and a remove button. Forces single-file selection.

  • "inherit" "lg" "md" "sm" "xs" "2xl" "xl" "inner" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the bottom-left and bottom-right corners.

  • "inherit" "lg" "md" "sm" "xs" "2xl" "xl" "inner" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the top-left and bottom-left corners.

  • "inherit" "lg" "md" "sm" "xs" "2xl" "xl" "inner" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the top-right and bottom-right corners.

  • "inherit" "lg" "md" "sm" "xs" "2xl" "xl" "inner" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the top-left and top-right corners. Overrides `radius` on those corners only (flush-edge chains).

  • "rounded" "circle"
    default "circle"

    Avatar corner shape (`layout="avatar"` only).

Behavior

  • accept svelte
    string

    Native `accept` filter forwarded to the file input.

  • autoUpload svelte
    boolean
    default true

    Start uploading as soon as files are accepted (otherwise call `engine.start()`).

  • capture svelte
    boolean "user" "environment"

    Native `capture` hint for camera/microphone sources.

  • concurrency svelte
    number
    default 3

    How many files upload at once.

  • dropTarget svelte
    string EventTarget

    Another element that accepts dropped files: `"document"` (the whole page), a CSS selector or an element. Pair it with an `UploadDropOverlay`.

  • getValue svelte
    UploadValueGetter

    Maps a stored entry to the value its hidden form input submits. Defaults to the response's `id` / `key` / `url`, then the entry `url`.

  • ImageDimensionsConstraint

    Width/height constraints applied to image files.

  • maxFiles svelte
    number

    Maximum number of accepted files.

  • maxSize svelte
    number

    Maximum size per file, in bytes. Larger files are rejected.

  • multiple svelte
    boolean

    Allow selecting multiple files.

  • (entries: UploadEntry[]) => void

    Fires with the full entry list whenever it changes.

  • onReject svelte
    (rejections: UploadRejection[]) => void

    Fires with the rejected files (and their reasons) whenever validation runs.

  • upload svelte
    UploadAdapter

    Uploads each accepted file: `(file, { onProgress, signal, entry })` → the server's response. With it, the engine runs the queue (progress, time left, retry, abort on remove) and the field `name` moves onto hidden inputs carrying each stored file's value.

  • validate svelte
    UploadValidator

    Custom per-file validator — return an error string to reject, `null` to accept. May be async.

Events

  • (entry: UploadEntry, error: unknown) => void

    Fires when an upload rejects.

  • (entry: UploadEntry) => void

    Fires when an upload resolves.

Slots

  • children slot svelte
    Snippet

    Extra dropzone content rendered after the trigger row.

  • description slot svelte
    Snippet string

    Secondary helper line under the title (e.g. accepted formats).

  • icon slot svelte
    Snippet

    Centered dropzone icon. Defaults to a built-in upload glyph.

  • title slot svelte
    Snippet string
    default "Choose a file or drag & drop it here"

    Dropzone headline — a plain string or a snippet for rich content. Overrides `labels.title`.

  • trigger slot svelte
    Snippet string
    default "Browse file"

    Trigger button label — a plain string renders the built-in button, a snippet takes over the trigger entirely. Overrides `labels.trigger`.

Advanced

  • element binding svelte
    HTMLInputElement null

    Bindable reference to the native `<input type="file">` element.

  • engine svelte
    HeadlessInputUpload

    Bindable handle to the headless engine (`addEntries`, `removeEntry`, `retry`, `start`, `clear`, the `$entries` store, …).

  • InputUploadPassThrough< RootElementAttributes, InputElementAttributes, IconElementAttributes, TitleElementAttributes, DescriptionElementAttributes, TriggerElementAttributes >

    Per-slot escape hatch bag — each slot accepts a Panda CSS `style` object and a `props` map of HTML attributes spread onto that slot's element.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-input-upload-config` so the client runtime hydrates this instance and `getPindoba(el, "input-upload")` can `update()` it. Frameworks with their own reactivity don't need it.

Plus all standard <input> HTML attributes.

UploadList

Content

  • UploadListLabels

    Every user-facing string: per-status row text, action labels, the live-region announcements and the list's accessible name.

  • string

    BCP 47 locale for sizes and durations (`Intl.NumberFormat`).

Appearance

  • "lg" "md" "sm" "xs"
    default "md"

    Row size for `density="compact"`: rows become control rows as tall as an `inline` dropzone of the same size, so the two line up when stacked.

Layout

  • number

    Fixed column count for `layout="grid"`. Omitted, tiles auto-fill from a minimum width.

  • "default" "compact"
    default "default"

    `compact` tightens rows: name and status share one line and in-flight uploads show a small ring instead of a bar. In a grid, tiles shrink and drop their caption.

  • "grid" "list"
    default "list"

    `list` — one row per file with a progress bar under it. `grid` — square thumbnail tiles (photo galleries); put a `layout="tile"` dropzone in the `append` slot for an "add" tile.

Advanced

  • UploadListPassThrough

    Per-slot escape hatch bag — each slot accepts a Panda CSS `style` object and a `props` map of HTML attributes spread onto that slot's element.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-upload-list-config` so the client runtime hydrates this instance and `getPindoba(el, "upload-list")` can `update()` it. Frameworks with their own reactivity don't need it.

UploadDropOverlay

Content

  • UploadDropOverlayLabels

    Overlay strings.

Layout

  • "absolute" "fixed"
    default "fixed"

    `fixed` covers the viewport (a page-wide `dropTarget="document"`); `absolute` covers the nearest positioned ancestor (a container target).

Advanced

  • { root?: InputUploadSlotPassThrough; content?: InputUploadSlotPassThrough; icon?: InputUploadSlotPassThrough; title?: InputUploadSlotPassThrough; description?: InputUploadSlotPassThrough; }

    Per-slot escape hatch bag.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-upload-drop-overlay-config` so the client runtime hydrates this instance and `getPindoba(el, "upload-drop-overlay")` can `update()` it. Frameworks with their own reactivity don't need it.

UploadButton

Content

  • UploadButtonLabels

    Every user-facing string: the button `label` and each rejection message (`tooLarge`, `wrongType`, `tooMany`, `minWidth`, `maxWidth`, `minHeight`, `maxHeight`, `aspectRatio`). Messages with values take a function or a `{placeholder}` template. Unset keys keep the English defaults; an explicit `label` prop wins over `labels.label`. In Astro only template strings survive to the client.

  • string

    BCP 47 locale for the file sizes interpolated into rejection messages (`{max}`, `{size}`), formatted with `Intl.NumberFormat` (`"pt-BR"` → `"1,5 kB"`). Omitted, sizes keep the English form (`"1.5 KB"`).

Appearance

  • "primary" "secondary" "ghost" "adaptive"
    default "secondary"

    Visual emphasis forwarded to the inner Pindoba `<Button>`.

  • "lg" "md" "sm" "xs"
    default "md"

    Size variant for the upload button.

  • "inherit" "danger" "neutral" "primary" "success" "warning"
    default neutral

    Semantic tone color forwarded to the inner Pindoba `<Button>`.

Layout

  • boolean
    default true

    Stretch the upload button to fill its container width.

Advanced

  • UploadButtonPassThrough< RootElementAttributes, InputElementAttributes, IconElementAttributes >

    Per-slot escape hatch bag — each slot accepts a Panda CSS `style` object and a `props` map of HTML attributes spread onto that slot's element.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-upload-button-config` so the client runtime hydrates this instance and `getPindoba(el, "upload-button")` can `update()` it. Frameworks with their own reactivity don't need it.

Type

  • Components
  • Blocks