Skip to Content
Liquid Glass UI
Components

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 render prop (e.g. a Button, avatar picker, or icon button), pass unstyled to style from scratch, or pass custom/render-prop children inside the Liquid Glass dropzone.
  • Three dropzone densities: default, sm, and single-row compact, automatically switching to Over-Glass when placed inside a glass Card or Dialog.
  • Built-in file validation & async upload lifecycle: Validates accept, maxSize, and maxFiles on both click and drag-and-drop; supports onUpload with progress tracking, abort-on-remove, retry, and automatic image thumbnail previews via Attachment.
  • Built-in 12-locale i18n: Automatically follows <LiquidGlassProvider locale> and supports local overrides via messages.
apple-liquid-ui/preview/upload-liquid-hero
MacBook · 16:10

Installation (Shadcn Registry)

npx shadcn@latest add @apple-liquid/upload

Custom 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:

apple-liquid-ui/preview/upload-custom-trigger
MacBook · 16:10

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:

apple-liquid-ui/preview/upload-compact
MacBook · 16:10

Set layout="grid" on UploadList to display uploaded files as a snap-scrollable gallery of vertical thumbnail cards:

apple-liquid-ui/preview/upload-gallery
MacBook · 16:10

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

PropTypeDefaultDescription
valueUploadFileItem[]—Controlled list of files
defaultValueUploadFileItem[][]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
onUploadUploadHandler—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
acceptstring—Allowed MIME types / extensions (e.g. "image/*,.pdf")
multiplebooleantrueAllow selecting or dropping multiple files
maxFilesnumber—Maximum number of files allowed
maxSizenumber—Maximum size per file in bytes
disabledbooleanfalseDisables picking, dropping, and removing files
glassbooleantrueLiquid Glass material; false renders 100% opaque surfaces
messagesPartial<UploadMessages>—Override built-in localized labels and validation messages

UploadTrigger

PropTypeDefaultDescription
renderRenderProp<UploadTriggerRenderState>—Replace the default dropzone with any custom trigger element
childrenReactNode | ((state) => ReactNode)—Custom content inside the dropzone (or render element), with live { isDragging, disabled, fileCount } state
unstyledbooleanfalseStrip 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 / draggingTitleReactNodeLocalizedPrimary heading in idle and drag-over states
descriptionReactNodeAuto-generatedHelper text (auto-built from accept, maxSize, maxFiles when omitted)
iconReactNode<CloudUploadIcon />Custom icon inside the squircle badge
browseLabelReactNode | nullLocalizedLabel on the visual browse pill (null hides it)
disableDropbooleanfalseDisable drag-and-drop while keeping click-to-browse

UploadList

PropTypeDefaultDescription
layout'list' | 'grid''list'Vertical list rows or horizontal snap-scrollable thumbnail cards
size'default' | 'sm' | 'xs''default'Density forwarded to Attachment items
childrenReactNode | ((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.

PropTypeDescription
localeLiquidGlassLocaleInputUI language of this component (any BCP 47 tag; unsupported ones fall back to English)
messagesPartial<UploadMessages>Text overrides, merged over the built-in text and the global messages.upload
KeyBuilt-in text (English)
titleDrop files here or click to upload
draggingTitleRelease to upload files
descriptionSelect files from your device or drag them into this area
browseBrowse Files
uploadingUploading
processingProcessing
failedUpload failed
removeRemove
retryRetry
clearAllClear all
maxSizeHintUp to {size}
maxFilesHintMax {count} files
fileTooLarge{name} exceeds the {size} limit
invalidType{name} is not a supported file type
tooManyFilesYou can upload up to {count} files

On this page