Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Storage Usage Account Block for React

What an account stores: one bar cut into five parts by pattern, a row for each with its size and share, and actions that free space after an alert dialog and can be undone.

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

Show people what fills their space and let them clear some of it, with this storage panel for React with Base UI. One bar stands for the account's whole allowance and is cut into Documents, Media, Backups, Trash and Cache by their typed sizes, with what is still free at its end. Each part has its own pattern, a solid, a mid tone, hatching, dots and stripes, and its name, size and share sit in a row under the bar, so nothing is told by tone alone. Three rows have one action that frees space: Clear cache, Delete old backups (the typed backups older than 90 days from the as-of day) and Empty trash. Each asks in an Alert Dialog first, with Cancel focused and a destructive action; confirming subtracts from the bar, the rows and the total, and Undo brings the last one back. The block has no Shine Button: the only actions are those confirms. It's built from Alert Dialog, Button and Guides, with a CSS entrance only. For account pages, file apps and any product with a storage allowance.

FAQ

How do I fill it with my own kinds of storage?

Edit KINDS (an id, a name, its size in megabytes, whether a button can clear it and a pattern) and CAPACITY. Backups are summed from the typed list BACKUPS, each with a day and a size, and only those older than KEEP_DAYS days from AS_OF can be deleted. Every size, share and sentence is worked out from these: the shares are rounded so that they and the free space add up to 100.

What stays local, and how do I make it real?

All of it. Confirming recounts this page and says so in the status line; no file, backup or cache is touched. To make it real, send the action to your server in the dialog's confirm handler, update the sizes from what it reports and keep the dialog: clearing a cache is harmless, but deleting backups and emptying a trash cannot be undone, and the page's Undo is only a demo of the sums.

Why patterns and not colours?

Colours fail for people who cannot tell them apart, and in a theme with one hue they run together. Each part is drawn with a different pattern, and the same pattern is the key beside its name in the rows, so the bar reads in grey. The bar itself is one image with a text alternative that gives every size, and the rows give the same figures as text.

How are the sizes written?

With a fixed English number format, so digits stay ASCII in every language and a right-to-left page: from a gigabyte up they are gigabytes to one decimal, below that whole megabytes. The bar and its figures are kept left to right, since a bar is read from empty to full in any language.

How does it look on a phone?

The bar spans the panel, and each row stacks: the pattern, name and words, then size and share at its end, then the button under them at full width. A row whose button has nothing to free waits quietly with the same label and says why if pressed, so rows never change height.

Is it accessible?

The dialogs are alert dialogs: focus starts on Cancel, Escape closes and focus returns to the button that opened it. Buttons say what they free and from where, the bar is a named image, and the one status line is polite and present from the start. Undo names what it will take back.

  • Pro

    Rules for deleting personal history automatically: a select for each kind of history, what each rule would delete worked out from typed counts, a popover of the oldest items and an alert dialog before a large delete.

  • Pro

    The archives an account has asked for and not yet taken: a type filter, a table with size, request day and time to expiry, real sample downloads, Request again for an expired one and Undo.

  • Pro

    Storage Optimized Success

    Servers and storage

    A confirmation panel for a compaction: three cells on shared hairlines, one table each, with the size before as a hollow bar, the size after solid and the reclaimed part hatched, worked out from typed sizes, and a toggle group that sorts the tables.

  • Pro

    Export requests as a lifecycle: a request checked with the password, a four-stage track that moves one stage per press, and a real sample file to download once it is ready.

  • Pro

    Storage Full Error

    Browser and device

    A full-screen page for a device that is out of room: a meter, a Check this browser button that reads the real storage estimate, and five steps for making room, with the shortcut as words for Mac or Windows.

  • Pro

    A file storage settings panel that leads with a 100 GB quota bar stacked by file type, a largest-file slider that rewrites a capacity sentence, allowed type toggles, versioning with a keep-last count and a provider choice.