Component Location:
design-system/components/AxUploaderOverview
AxUploader is a drag-and-drop file upload zone built on Ant Design’s Upload.Dragger. It supports file size validation, custom icons, and three size presets for different layout contexts.
Import
Basic Usage
With File Size Validation
Size Variants
Props
Main text displayed inside the upload area. If the text contains “choose file”, that phrase will be styled as a clickable link.
Hint text shown below the description. Use to communicate file type and size constraints.Example:
"Supports .xlsx, .xls and .csv (max 10MB)"Custom icon to display in the upload area. Defaults to
<CloudUploadOutlined /> from Ant Design icons.Maximum file size in megabytes. Files exceeding this limit are automatically rejected and
onReject is called.Callback fired when a file is rejected (e.g., exceeds
maxSizeMB). Use this to display error messages to the user.Parameters:file: The rejected File objectreason: Human-readable rejection reason (e.g., “File exceeds 10MB limit”)
Size preset controlling padding and icon sizing.
"sm"— Compact size for modals and drawers"md"— Standard size (default)"lg"— Large size for full-width page layouts
Show Ant Design’s built-in file list after upload. By default, this is
false because consumers typically manage file state themselves (e.g., using AxFileItem).All other props from Ant Design’s
UploadProps are supported, including:accept— File type filter (e.g.,".xlsx,.csv")multiple— Allow multiple file selectiononChange— Callback for upload lifecycle eventsbeforeUpload— Custom validation before uploadcustomRequest— Override default upload behavior
Type Definitions
AxUploaderSize
AxUploaderProps
Examples
Excel File Upload
Image Upload with Preview
Custom Upload Handler
Small Size for Modal
Manual File Handling
Behavior Notes
- Auto-rejection: Files exceeding
maxSizeMBreturnUpload.LIST_IGNOREto prevent them from appearing in the file list - “Choose file” styling: The component automatically detects “choose file” in the description text and styles it as a clickable link
- Default
beforeUpload: Returnsfalseto prevent automatic upload, giving you control over when and how files are uploaded - Size validation: Happens in
beforeUpload, before any upload request is made
Accessibility
- The upload area is keyboard accessible (Enter/Space to open file picker)
- Icon is marked
aria-hidden="true"to avoid redundant announcements - Drag-and-drop interactions are announced by screen readers via Ant Design’s built-in ARIA support
Design Notes
- Uses Ant Design’s
Upload.Draggercomponent internally - Icon sizing and padding scale with the
sizeprop - Border changes to dashed on hover/drag to indicate interactivity
- The phrase “choose file” is automatically highlighted in cyan when detected in the description