shadcn.io is not affiliated with official shadcn/ui
File Storage Settings Block for React
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.
Installation
Overview
See how much room a workspace has left and what each rule costs, with this file storage settings panel for React with Base UI. A bar leads, 100 GB stacked by what is in it, Documents, Media, Backups, Other and the extra versions kept, with a legend of figures and the free space. Under it a Slider with eight stops sets the largest file from 1 to 500 MB and rewrites a sentence: how many 4 MB photos the free space still holds, and how many files at the limit. A Toggle Group picks the allowed types and lists the extensions they accept; the last one cannot be switched off. A Switch turns on versioning and a Number Input sets how many versions to keep, from 1 to 20, and the cost shows in the bar at once. Three Radio Group cards choose the provider, Amazon S3, Google Cloud Storage or Azure Blob, each as text with a two-letter tile. The action foot counts unsaved changes beside a Shine Button that saves them and an outline button that discards them. It's built from Slider, Toggle Group, Switch, Number Input, Radio Group, Field, Button, Shine Button and Guides, with a CSS entrance only. For a drive, a file host or any app that sells room.
FAQ
Where do the figures in the bar come from?
USED types the four sizes in gigabytes, and the Versions piece is worked out as one more version times 1.2 GB for each version you keep beyond the file itself, so keeping five adds 4.8 GB. Free space is the 100 GB total minus all of it. The bar is a single image with the whole breakdown in its name, and the legend repeats it as figures.
What does the Largest file slider change?
Only the sentence and what you save. It has eight stops, the slider's value is the stop's place in the list, and it reads out in words such as "25 MB". The photo count is the free gigabytes times 1,024 over 4 MB, and the file count is the same over the limit, both rounded down. Change PHOTO_MB for a different example file.
Why can't I switch off the last type?
Then nothing could be uploaded, so the toggles stay as they are and the status line says to keep at least one type. The extensions under the toggles are a typed list for each type; extend TYPES and check the real file type on your server, because an extension in the name proves nothing.
What stays local, and how do I make it real?
Everything. No file is stored or moved, Save keeps the settings in this page's state and says so, and choosing a provider changes nothing that already exists. In your app save the limit, the types, the versioning rule and the provider with the workspace, enforce the limit and the types on your server at upload, and prune versions with a job that runs after each overwrite.
How does it work by keyboard and on a phone?
The slider, the toggles, the switch, the number field and the radio cards are all named and keyboard operable; the toggles are a group you can Tab into and move through with the arrow keys. The number field is greyed while versioning is off, and a bad value is named under it. On a phone the legend becomes two columns, the provider cards stack and the action foot is pinned to the bottom of the screen.
Related
- Pro
An image variants settings panel with a table of three generated sizes, each with a width, a format and a quality slider, an estimated file size from a typed formula, greyscale sample tiles drawn at the three widths and two processing switches.
- Pro
Usage Limits Settings
Product controlsA row for each resource with a usage bar, a limit field, a policy for what happens at the limit (default, block, throttle or bill extra) and a sentence that restates the outcome, plus a default every row can follow.
- Pro
Backup Schedule Settings
Backups and exportsA backup schedule panel that leads with what the schedule amounts to (the next run, how much history the copies cover, how much space they take), with frequency, time, retention and destination controls beside a list of the next five runs.
- Pro
Audit Log Retention Settings
Backups and exportsAn audit log retention panel with a row for each class of event, a preset for how long to keep it, an archive-after menu, a legal hold that freezes the row and a two-part bar to one scale, with the gigabytes searchable and archived added up from typed daily volumes.
- Pro
Cache Policy Settings
Domains and deliveryAn ordered table of cache rules where first match wins: each path pattern has a freshness bar, how long a copy stays fresh and how long a stale one may be served, a count of the cached paths it really claims, and a purge that counts what it would clear.
- Pro
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.