Upload
Upload component using react-dropzone.
Single Upload:
Drop or select file
Drop files here or clickbrowsethorough your machine
Multiple Upload:
Drop or select multiple file
Drop files here or clickbrowsethorough your machine
With error:
Drop or select file
Drop files here or clickbrowsethorough your machine
Invalid file format
Installation
Install the following dependencies:
1. Copy and paste the following code into your project.
2. Create these 4 components preview-multi-file.tsx
, preview-single-file.tsx
, rejection-files.tsx
, upload-placeholder.tsx
inside the @/components/ui/upload
directory.
preview-multi-file.tsx
You can create your own transition on preview-multi-file
or copy this transition.
The fData
can be placed in @/lib/format-number.ts
.
preview-single-file.tsx
rejection-files.tsx
upload-placeholder.tsx
3. Now, create a directory inside components/ui
named file-thumbnail
, create and copy & paste these files file-thumbnail.tsx
, download-button.tsx
, utils.ts
.
file-thumbnail.tsx
download-button.tsx
utils.ts