shadcn.io is not affiliated with official shadcn/ui
No Files Empty State Block for React
A 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.
Installation
Overview
Show an empty file manager as the app it is about to become, with this no files empty state for React with Base UI. A hairline frame with a plus mark on each corner holds a window of fixed height for Cairnfile, file storage: the catalog Sidebar with All files, Recent and Trash and a count on each, which collapses to an icon rail with tooltips and is a sheet on a phone, and a page with a top bar and the Shine Button, the only colored control: Choose files. In All files the page is a large dashed drop zone with a drawn filing drawer pulled open, a dashed folder standing in it where the first file will go, over a table of the files chosen: name, type and size, all read from each file, and a button to move it to Trash. The first file turns the folder solid. Recent shows the five newest files, Trash holds what was removed and has Restore. The File Upload does the picking and dropping, the frame is ruled by Guides, and everything moves with CSS only. For the empty page of any storage or document app.
FAQ
What stays in the page, and how do I make it real?
The files stay in the tab: the page reads only each file's name, size and type, never its contents, so nothing is opened or uploaded, a reload empties the window and the counts follow every change. To wire it for real, upload each file where the code says so, add its row from your response, and keep Trash as a flag on the file instead of a second list.
Why is it a window, and what does the sidebar do?
A file manager lives inside an app, so the block is the app's own frame: the catalog Sidebar for the places, a top bar with the page's heading and its one action, and a page whose table scrolls on its own. The window keeps its height whatever you do. The rail's links change the page and its heading, and each is named with its count, such as All files, 3 files.
What do Recent and Trash show?
Recent lists the five newest files, newest first. Move to Trash on a row takes the file out of All files and Recent and into Trash, the counts change, and focus goes to the next row. In Trash, Restore puts the file back. Nothing is deleted for good in this demo, so a reload is the only way to empty it.
Is it usable with a keyboard and a screen reader?
Tab runs through the sidebar, the top bar, the drop zone and the table, which is a focusable region of its own because it scrolls. The zone opens the file picker on Enter or Space, and the one polite status line at the foot says what changed. The drawing is hidden from assistive technology.
How does it look on a phone?
The sidebar becomes a sheet that the top bar's trigger opens, and a choice closes it with focus back on the trigger. The zone is shorter and drops its extra line, the table drops its Type column, and the button stays in the top bar. The window keeps its height and nothing scrolls sideways, even at 320 px wide.
Does anything change the window's height?
No. The window is a fixed height from the medium breakpoint (46rem) and a shorter one on phones (36rem); the drop zone keeps its size when files arrive, and only the table scrolls inside its own region, so adding or moving files never moves the page around the window.
Related
- Pro
Email Client Sidebar
App contentA mail client in a fixed-height window: mailboxes and labels whose counts follow the mail you file, a searchable message list beside the open message, and Compose for a local draft.
- 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
No Folders Empty State
Files and docsA file organiser's empty folder view: a breadcrumb with an Up button, a shelf of four slots that fill with folders you name, each one opening onto its own empty folder, and a drawn stack of three folders with the top one dashed.
- Pro
No Media Empty State
Files and docsA media library's empty shelf: six tiles on shared hairlines, each with its own tiny drawn scene, that fill one by one with your own pictures, their file names and a Remove that puts the scene back.
- Pro
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.
- Pro
No Attachments Empty State
Files and docsA task's empty attachments popover shown open in place: a drawn paperclip holding a dashed sheet, Attachment rows that are dashed while there is room and done per file, and one Attach files button.