Skip to content
shadcn.io

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.

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

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.

Does the block change size while I type?

No. Every cell always has the same three lines (the share, the bar and the user's place), and the answer under the field reserves its room, so nothing moves.

How does it work in a right-to-left layout?

The table and the field mirror. Bars, ticks and ids are drawn left to right, because a share is a distance from zero, and numbers keep their reading order.

  • Pro

    Feature Flag History Changelog

    Deploys and rollouts

    A 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

    A 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 rollouts

    Six 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 rollouts

    A 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 rollouts

    A 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 commits

    A 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.