shadcn.io is not affiliated with official shadcn/ui
Feature Flag Enabled Success Block for React
A confirmation panel for a feature flag that went live: a strip of figures over a rollout dial that moves by stops, an Environment switch, the number of users it reaches worked out from typed audiences, and a local Roll back.
Installation
Overview
Confirm that a flag is live and let people widen or narrow it, with this confirmation panel for React with Base UI. It is the Flagwren page after a feature flag went on, as a panel under a compact header. Inside a hairline frame a strip of three figures names the flag's key, the share of users it is on for and how many users that is. Under it a Slider moves the rollout by stops (off, 1%, 5%, 10%, 25%, 50% and 100%) with a ruler under the track, an Environment Toggle Group switches between Production and Staging, and one sentence says what the dial amounts to ("About 3,100 of 12,400 users in Production see it"). A side cell holds the audience, the targeting rule, when it was enabled and who owns it. The foot has a status line, the one Shine Button, View analytics, and an outline Button, Roll back. Nothing is toggled: the audiences and rollouts are typed sample data. For flag, experiment and staged-release tools, or the page after any change that can be widened gradually.
FAQ
What stays in the page, and how do I wire it for real?
Nothing was toggled. The two audiences (12,400 users in Production, 380 in Staging), the starting rollouts (Production at 25%, Staging at 100%) and the people and dates are typed constants at the top of the file, and the dial only redraws the page. To wire it, read the flag from your flags API into ENVS and START, send the new stop from the slider's change handler (the polite status already waits until the dial rests, so you can send on the same beat), and put the error in the status line if the request fails. Roll back is a local move to 0% today: make it call your own rollback endpoint.
How does the dial move, and how does a screen reader hear it?
The slider's value is the stop's place, not a percentage: six steps that carry a ruler of seven labels spaced evenly, so 1% and 5% are not squeezed together. The arrow keys move one stop, Home and End go to 0% and 100%, and its value text is the stop's own words ("25%"). The sentence under the dial changes at once; the polite status line says the new reach about 600 milliseconds after the dial rests, so an arrow key held down does not read out every step.
What does the Environment switch change?
Each environment keeps its own rollout and has its own audience. Switching from Production to Staging moves the dial to Staging's stop, redraws the figures and the sentence from Staging's 380 users, and says so in the status line; switching back finds Production where you left it. The group always has one pressed item.
What does Roll back do?
It puts the open environment on 0%, draws the dial there and says "Production rolled back to 0%." in the status line. At 0% the button stays in place and keeps its focus, looks quiet, and answers a press with "Already at 0%. Nothing to roll back." instead of disappearing. Nothing is sent to a server in this demo.
Where do the user counts come from?
They are worked out from the environment's typed audience and the stop's share, rounded to a whole user, so 25% of 12,400 is 3,100. The text says "about" because real flag services assign users by hashing, which lands near the share but rarely on it. The strip, the sentence and the status line all come from the same helper, so they never disagree.
Related
- Pro
Rate Limit Increase Success
Plans and limitsA confirmation panel for a raised API limit: a group of buttons for all regions, EU and US, one derived sentence with a before-and-now meter, three endpoints with the same paired bars and their limits in words, the burst bucket, and a local benchmark.
- Pro
Deployment Live Success
Builds and deploysA confirmation window for a live deploy: a drawn browser with the real address and a copy button, a group of buttons that redraws the site at desktop, tablet and phone width, and the deploy's facts and four passed checks beside it.
- Pro
Cluster Scaled Success
Servers and storageA confirmation window for a scaled cluster: twelve node slots in a framed canvas that a number field redraws, an Autoscale switch that dashes the room to grow, and the vCPU, memory, requests and monthly cost worked out from typed per-node figures.
- Pro
Feature Flag History Changelog
Deploys and rolloutsA framed table of flag changes with each state drawn as a switch and a word, a rollout bar with its share in words, and the audience rule in a popover.
- Pro
Environment Variables Settings
Domains and deliveryAn environment variables settings panel that shows where each variable is set across Production, Preview and Development, counts what is missing, fills a missing value with Copy from, and previews a pasted .env file before it imports.
- Pro
Build Passed Success
Builds and deploysA confirmation window for a green build: a bar of four stages as wide as their share of the run, a typed terminal log for the chosen stage with a once-only replay, a small artifacts table and a local Deploy this build.