shadcn.io is not affiliated with official shadcn/ui
Password Policy Dashboard Block for Radix UI
A password policy simulator: a minimum length and three switches tried on 40 sample accounts in four groups, with how many each rule fails, a compliant share bar per group and the failing accounts of the group you pick.
Installation
Overview
Try a password rule on your people before you enforce it, with this password policy panel for React with Radix UI. A hairline frame with a plus mark on each corner opens with the rules: a Number Input for the minimum length from 8 to 20 and three Switches (require a symbol, block known-breached passwords, expire after 90 days), each saying how many of the 40 sample accounts it fails on its own. Under it a "Who would fail" band shows four groups (Engineering, Finance, Support and Contractors) as rows with a bar for the compliant share and a count of failing accounts. Pick a group and a list shows its failing accounts as initials with the rules each one breaks, and the header sentence compares the total with today's applied policy ("14 of 40 sample accounts would fail this policy, 6 more than today's policy"). The Shine Button in the action foot applies the draft as today's policy in the page, and Reset puts it back. It's built from Number Input, Switch, Button, Shine Button and Guides. For admin consoles and security settings.
FAQ
How do I use my own accounts?
Replace ROWS. Each line is a group, two initials, the password's length, whether it has a symbol, whether it is known to be breached and its age in days, joined by |, and GROUPS names the groups. The failing sets, the bars and the sentence are worked out from them by small pure helpers. Never load real passwords into the browser: compute these four facts on your server and send only the facts.
How is each rule decided?
The length rule fails an account shorter than the minimum, the symbol rule one with no symbol, the breach rule one flagged as breached, and the expiry rule one older than 90 days. An account can break several, and the list for a group shows all of them. The count beside each rule is that rule alone, so the counts can add up to more than the total.
How does the length field behave?
You can type any number; the results use it clamped to 8 to 20, and when the field loses focus it settles to that value.
What does Apply policy do?
It keeps the draft as the policy "today" in this page, so the header sentence then compares against it, and the status line says it was previewed in this demo only. Nothing is enforced and no account is touched. To make it real, send the policy to your identity provider's settings and show its response.