Open ImperishableMe opened 3 weeks ago
@radnan bhaia, can you please assign this to me? And also, please let me know if the Issue details look reasonable to you.
instead of dragAndDrop
boolean - we can add an onDrop
prop. so by default users can both click to upload a file - or drag and drop files - no reason to toggle dnd in any way.
feel free to use a third party app like https://react-dropzone.js.org/ to make things easier
ideally we should also support the following props - but for now just multiple
is good enough
accept
- list of mime types that is alloweddisabled
whether the uploader is disabledloading
whether to show spinner to denote that uploading is in progressNot sure if you've started on this already or not - but another good option is https://ark-ui.com/react/docs/components/file-upload since radix-ui doesn't have it yet
Not sure if you've started on this already or not - but another good option is https://ark-ui.com/react/docs/components/file-upload since radix-ui doesn't have it yet
I am having a look at this bhai. I was OOO for some days.
Add a FileUploader Component that can be wrapped around a children to give it drag and drop functionality i.e. it will detect any drag and drop events.
We can also provide some customization options such as:
dragAndDrop
: aboolean
that signifies whether the component will allow file drag and dropmultiple
: aboolean
that signifies whether the component will allow multiple files to dragged into the area together.For the initial version however, maybe we can skip the customisation and provide the basic functionalities.