Skip to content

File Upload

File Uploads are used to allow users to select and upload files from their local device to a web application. They are commonly used in forms, content management systems, and any scenario where file submission is required.

Loading Code Block...

To get started, install Butterfly DS via aqua:

Loading Code Block...
Loading Code Block...
Loading Code Block...
Loading Code Block...

PropsDefaultTypeDescription
variantTypedrag'drag' | 'image' | 'profile'The variant type of the file upload component
maxFiles2numberThe maximum number of files that can be uploaded
multiplefalsebooleanWhether to allow multiple file uploads
maxFileSize5numberThe maximum file size allowed for uploads in MB
disabledfalsebooleanWhether the file upload component is disabled
onFileUpload-functionCallback function triggered when files are uploaded
showSizeInfotruebooleanWhether to show size restrictions on file uploads
acceptall'image' | 'document' | 'pdf' | 'all'The file types that are accepted for upload, e.g., 'image/*' for images
titleUpload ImagestringTitle displayed in the file upload area
descriptionClick to uploadstringDescription displayed in the file upload area
className-stringCustom CSS class for additional styling
icon
icon icon icon icon