shadcn.io is not affiliated with official shadcn/ui
Empty State File Upload Block for React Aria
An illustrated empty state whose drawn folder is the drop zone: a pick closes the folder and lists the file, with working Add files, Paste a link and New folder shortcuts.
Installation
Overview
Turn the first empty screen into the first upload, with this file upload panel for React with React Aria. It is the empty state of Tidyfile, a document organiser for freelancers. The catalog Empty holds a drawn open folder that is itself the File Upload drop zone. A pick or a drop closes the folder, with the sheets sinking and the front panel rising in CSS, and the file's name drops into a list under it with a count. Three shortcuts really work: Add files, the one Shine Button, opens the picker; Paste a link opens an inline Input that parses the URL and lists its host and path; New folder opens one that checks the name for slashes and for a twin. The inline field has a reserved slot, so opening it moves nothing. The panel is ruled by Guides. It is built from Empty, File Upload, Input, Button, Shine Button and Guides, with a CSS entrance only. For file managers, document apps and any list that starts empty.
FAQ
How does the folder close?
It is an inline SVG with three parts: a back panel, two sheets and a front panel. When the list has an item the sheets fade and sink and the front panel scales up from its foot, all with a CSS transition that reduced motion switches off. The drawing is hidden from screen readers; the drop zone around it is named "Drop files on the folder, or press to choose".
Does Paste a link fetch anything?
No. The link is parsed in the browser with the URL class: only http and https links with a dotted host are accepted, and the list shows the host and path. A bad link shows its problem under the field and keeps focus there. Nothing is requested.
What does New folder check?
That the name is one to forty characters, has no slash and is not already a folder here, ignoring case. The folder is added to the list as an empty folder in local state.
Does it read the files I add?
No. A file joins the list with its name and its size, and the block says in a polite status line that nothing is uploaded. Files over 100 MB are refused with a message.