Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Retention Policy File Upload Block for React Aria

Retention rules for a law firm's archive, a default and a duration per kind of file with a grace period and an archive switch, tested against seven sample files that say what happens to each today.

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

Write the rules and watch what they do, with this retention settings panel for React with React Aria. It is the records retention of Keepspan, a document archive for a law firm. On one side are the rules: a default duration in a Native Select, a duration for each of five kinds of file (contracts, correspondence, court filings, drafts, intake scans) or "use the default", a grace period of 7, 14 or 30 days in a Segment Group, and a Switch that moves expired files to the archive instead of deleting them. On the other side are seven sample files with a kind and a creation date, and each shows what happens to it today: kept, in grace, moves to the archive, or deleted. Pick one and a sentence says so, "Kept for 19 more days" or "In grace: moves to the archive in 10 days", with the rule, the file's age and its expiry and grace dates under it. The tester runs on the rules as drafted, so every change shows at once, before Save. The panel is ruled by Guides. For records, legal hold and any archive where "how long" needs an answer a person can check.

FAQ

How is the outcome worked out?

From three numbers and the as-of date. A file's age is the days between its creation date and the as-of day; its rule is its kind's duration, or the default when the kind follows it; the grace period is the setting. Under the rule it is kept; between the rule and the rule plus grace it is in grace and can still be restored; past that it moves to the archive or is deleted, depending on the switch. The same function fills the list, the sentence and the tally.

Why does the tester change before I save?

Because it reads the draft, not the saved rules. That is the point of a tester: you see the effect of 7 years instead of 3 on the sample files first. The status line counts unsaved changes, Save keeps them and Discard puts the saved rules back.

Where do the dates come from?

Each sample's creation date is typed, and "now" is a fixed constant, so the outcomes are the same on every visit and in every time zone. Expiry and grace dates are the creation date plus the rule, counted in whole days.

What stays local, and how do I wire it?

Everything. Nothing is deleted or archived, and the seven files are samples. To wire it, save the rules to your policy API, evaluate real files on the server on a schedule, and keep the legal holds and audit trail your records law needs: a browser tester is for explaining the rules, not enforcing them.

How do I use it from the keyboard?

Every control is a native select, a labelled switch, a segmented group of radios or a button. The sample files are buttons in a list with the chosen one marked as current, and the result sentence is announced politely when it changes.