shadcn.io is not affiliated with official shadcn/ui
Flag Environment Matrix Changelog Block for React
A flag by environment table with a rollout share, a shape and a word in each cell, and a user id field that buckets the user and marks where they are in or out.
Installation
Overview
A flag matrix for React with Base UI, written for Sluicebox, a fictional rollout service. A start-aligned header says from the data how many flags are fully on in production, and under it an inset frame with + marks on its corners holds one table: a row per flag, a column for Dev, Staging and Production. Each cell gives the rollout share, a shape and a word for where it stands (a filled square for On, a half one for Rolling out, an empty one for Off), a bar, and what that means for one user: in the rollout or out of it. The frame's foot is a targeting check: type a user id and a small hash turns it into a bucket from 0 to 99, a user is in a rollout while their bucket is under its share, and a line counts the flags that are on for them in each environment. It's built from Guides, Field and Input, with CSS transitions for the entrance and your theme's tokens for every colour. For rollout dashboards and flag docs. The flags and shares are example data, and nothing you type leaves the page.
FAQ
How do I change the flags and their shares?
Edit GATES at the top of the file: a key and a share from 0 to 100 for each of dev, staging and production. The state word (Off at 0, On at 100, Rolling out between), the headline count and every cell are computed from the numbers.
How is the bucket worked out?
bucketOf folds the characters of the id into a number and scatters it, which gives the same bucket from 0 to 99 for the same id every time. A user is in a rollout while their bucket is under its share, so widening a rollout only ever adds users. It's a small demonstration hash: use your service's own bucketing in production.
What happens when I type?
The cells and the counts under the field update at once and nothing is sent anywhere. Screen readers hear the bucket once typing pauses, not on every key. An empty field shows no bucket and every cell says "No user".
Is it a real table?
Yes: a native table with a caption, scope on every header and the flag key as the row header. Below md the three environments move under each key as a list, so a row keeps its shares without scrolling sideways.
Related
- 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 Promotion Ladder Changelog
Deploys and rolloutsA promotion ladder of four stages as rows with a rollout bar, time in stage and a Collapsible that lists each stage's gates.
- Pro
Percentage Fill Region Rollout
Deploys and rolloutsSix regions as rail-to-rail rows whose own background fills to the rolled-out percentage, with latency, a state shape and word, an end date, and a traffic-weighted overall figure.
- Pro
Slider Rollout Runtime Flags
Deploys and rolloutsA feature flag with a slider from 0 to 100 percent that lights a hundred user dots and writes the config as JSON with a Copy button, a badge that says Off, Partial or Full, and the targeting rule as inline code.
- Pro
Canary Release Ramp Changelog
Deploys and rolloutsA split with a five-step canary ramp as buttons at the start and, at the end, the chosen step as canary against stable in two cells with a guard-rail bar.
- Pro
Code Owners Changelog
Code and commitsA path tester: type a file path and see which team owns it, the pattern that matched and the number of reviewers, with the owning row ringed in a framed table of teams, patterns, reviewers and wait times.