shadcn.io is not affiliated with official shadcn/ui
Empty State File Upload Block for React
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 Base UI. 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.
Related
- Pro
A drawn project brief that is itself the drop zone: nothing shows until a file is dragged over it, then a full-bleed message appears, and dropped files join an attachments list with a short bar.
- Pro
A project folder's drop zone that folds into a slim Add more strip over its file list as files arrive, with a running total against 25 MB, Remove on each row and Clear all.
- Pro
No Files Empty State
Files and docsA file manager's empty All files page in a framed window: the catalog sidebar with its counts, a large dashed drop zone with a drawn filing drawer, and a table that lists the files you choose or drop.
- Pro
No Uploads Empty State
Files and docsA transfer tool's uploads page as a whole screen: one big dashed drop zone with a drawn letterbox, the rules shown and enforced, and two lists, the files added and the files turned down with their reasons.
- Pro
A deep inset drop zone whose 1 px edge lights up where the pointer is and glows evenly on focus, over a tray of attachment rows with Remove and Clear tray.
- Pro
A phone-first uploader drawn in a 360 px device frame: a large Choose files target, a Take photo camera shortcut, compact file chips and a bottom drawer quick look with Remove.