Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Empty State File Upload Block for Svelte

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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Turn the first empty screen into the first upload, with this file upload panel for Svelte with Ark 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".

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.

Where does focus go?

Opening a shortcut focuses its field; adding or cancelling returns focus to the button that opened it. Removing a row focuses the next row's Remove button, or Add files when the list is empty. Remove buttons are 44 px on a phone.

How do I connect it to my app?

Replace the local list with your documents. Send picked files from the accepted handler to your storage, resolve links on your server (never in the browser), and create folders through your API; show the empty state again when the list is empty.