Upload
Apple Liquid Glass file upload component with a refined default dropzone, drag-and-drop, file validation, upload progress, and full custom trigger support.
A composable file upload component (Upload / UploadTrigger / UploadList / UploadItem / UploadError / UploadClear / useUpload) styled for Apple macOS 27 & iOS 27 Liquid Glass:
- Refined default Liquid Glass dropzone: Features a translucent glass surface with SDF optical edge refraction, an inset dashed drop frame, an accent-tinted icon squircle, and an interactive drag-over highlight.
- Full custom trigger support: Replace the trigger element completely via the polymorphic
renderprop (e.g. aButton, avatar picker, or icon button), passunstyledto style from scratch, or pass custom/render-propchildreninside the Liquid Glass dropzone. - Three dropzone densities:
default,sm, and single-rowcompact, automatically switching to Over-Glass when placed inside a glassCardorDialog. - Built-in file validation & async upload lifecycle: Validates
accept,maxSize, andmaxFileson both click and drag-and-drop; supportsonUploadwith progress tracking, abort-on-remove, retry, and automatic image thumbnail previews viaAttachment. - Built-in 12-locale i18n: Automatically follows
<LiquidGlassProvider locale>and supports local overrides viamessages.
Installation (Shadcn Registry)
npx shadcn@latest add @apple-liquid/uploadCustom Trigger Styles
Use render to turn any element (Button, avatar, icon button, etc.) into a clickable and drop-enabled upload trigger, or pass a render-prop function as children to customize the content inside the Liquid Glass dropzone:
Compact & Inside a Glass Card
Use size="compact" for a sleek single-row dropzone that adapts to Over-Glass automatically inside a Liquid Glass Card:
Image Gallery Grid
Set layout="grid" on UploadList to display uploaded files as a snap-scrollable gallery of vertical thumbnail cards:
Usage
import { Button } from '@/components/ui/button';
import {
Upload,
UploadError,
UploadList,
UploadTrigger,
} from '@/components/ui/upload';
export function Example() {
return (
<Upload accept="image/*,.pdf" maxSize={10 * 1024 * 1024}>
<UploadTrigger />
<UploadError />
<UploadList />
</Upload>
);
}
export function CustomButtonTrigger() {
return (
<Upload accept=".pdf,.md">
<UploadTrigger render={<Button glass>Choose File</Button>} />
<UploadList size="sm" />
</Upload>
);
}Props API
Upload
| Prop | Type | Default | Description |
|---|---|---|---|
value | UploadFileItem[] | — | Controlled list of files |
defaultValue | UploadFileItem[] | [] | Initial file list for uncontrolled usage |
onValueChange | (files: UploadFileItem[]) => void | — | Called whenever the file list changes |
onFilesAdded | (items: UploadFileItem[], rawFiles: File[]) => void | — | Called with newly accepted files after validation |
onUpload | UploadHandler | — | Async upload handler receiving (item, { setProgress, setStatus, signal }) |
onRemove | (item: UploadFileItem) => void | — | Called when a file is removed |
onReject | (rejections: UploadRejection[]) => void | — | Called when files fail validation |
accept | string | — | Allowed MIME types / extensions (e.g. "image/*,.pdf") |
multiple | boolean | true | Allow selecting or dropping multiple files |
maxFiles | number | — | Maximum number of files allowed |
maxSize | number | — | Maximum size per file in bytes |
disabled | boolean | false | Disables picking, dropping, and removing files |
glass | boolean | true | Liquid Glass material; false renders 100% opaque surfaces |
messages | Partial<UploadMessages> | — | Override built-in localized labels and validation messages |
UploadTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
render | RenderProp<UploadTriggerRenderState> | — | Replace the default dropzone with any custom trigger element |
children | ReactNode | ((state) => ReactNode) | — | Custom content inside the dropzone (or render element), with live { isDragging, disabled, fileCount } state |
unstyled | boolean | false | Strip default glass dropzone styling so you can style via className |
size | 'default' | 'sm' | 'compact' | 'default' | Dropzone density (compact renders a horizontal single-row bar) |
title / draggingTitle | ReactNode | Localized | Primary heading in idle and drag-over states |
description | ReactNode | Auto-generated | Helper text (auto-built from accept, maxSize, maxFiles when omitted) |
icon | ReactNode | <CloudUploadIcon /> | Custom icon inside the squircle badge |
browseLabel | ReactNode | null | Localized | Label on the visual browse pill (null hides it) |
disableDrop | boolean | false | Disable drag-and-drop while keeping click-to-browse |
UploadList
| Prop | Type | Default | Description |
|---|---|---|---|
layout | 'list' | 'grid' | 'list' | Vertical list rows or horizontal snap-scrollable thumbnail cards |
size | 'default' | 'sm' | 'xs' | 'default' | Density forwarded to Attachment items |
children | ReactNode | ((item: UploadFileItem) => ReactNode) | — | Optional custom item renderer |
Language & Text
Upload accepts locale and messages, which apply to all of its parts and the overlays it opens and win over the global <LiquidGlassProvider locale messages>. To override the text globally, put it under messages.upload on the provider. See Liquid Glass → Global settings.
| Prop | Type | Description |
|---|---|---|
locale | LiquidGlassLocaleInput | UI language of this component (any BCP 47 tag; unsupported ones fall back to English) |
messages | Partial<UploadMessages> | Text overrides, merged over the built-in text and the global messages.upload |
| Key | Built-in text (English) |
|---|---|
title | Drop files here or click to upload |
draggingTitle | Release to upload files |
description | Select files from your device or drag them into this area |
browse | Browse Files |
uploading | Uploading |
processing | Processing |
failed | Upload failed |
remove | Remove |
retry | Retry |
clearAll | Clear all |
maxSizeHint | Up to {size} |
maxFilesHint | Max {count} files |
fileTooLarge | {name} exceeds the {size} limit |
invalidType | {name} is not a supported file type |
tooManyFiles | You can upload up to {count} files |
Tree
macOS 27 Outline View-style tree with expand / collapse, single selection and cascading checkboxes, plus a TreeSelect that opens a Liquid Glass menu on desktop and an iOS 27 bottom Drawer on mobile.
DataTable
An admin list block powered by TanStack Table v9 with server-side pagination, sorting, filtering (text, select, date range), column visibility, row selection, and tree rows in Apple 27 Liquid Glass.