Feature Flag Rollout

Feature Flag Rollout is a copy-paste React component that stops feature flag released to everyone early before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/feature-flag-rollout
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsFeature flag released to everyone early

Was this component page useful?

How do I install Feature Flag Rollout?

pnpm dlx shadcn@latest add @bollard/feature-flag-rollout

The files land in your project. They're yours to edit.

How do I use Feature Flag Rollout in React?

feature-flag-rollout-usage.tsx
import { FeatureFlagRollout, type RolloutValue } from "@/components/ui/feature-flag-rollout"

return <FeatureFlagRollout environments={environments} segments={segments} defaultValue={saved} defaultDraft={draft} />

What input mistakes does Feature Flag Rollout catch?

  • Production rollouts that skip ramp steps
  • Production ahead of staging
  • Who actually gets the flag, counted in users
  • How many users lose the feature on a pullback

What props does Feature Flag Rollout accept?

FeatureFlagRollout props
PropTypeDefault
environments* (required)

Environments in promotion order, e.g. dev → staging → production.

RolloutEnvironment[]—
segments

Segments that can be switched on per environment (staff, beta testers…).

RolloutSegment[][]
value

Saved rollout (controlled).

RolloutValue—
defaultValue

Saved rollout when uncontrolled.

RolloutValue{}
defaultDraft

Unsaved edit to start from, e.g. a change restored from a link. Defaults to the saved rollout.

RolloutValue—
onValueChange

Called with the new rollout when the user saves. May return a promise.

(value: RolloutValue) => void | Promise<void>—
steps

Ramp steps for production. Raising past the next step asks for confirmation.

number[][5, 10, 25, 50, 100]
messages

Warning text per issue. `{env}`, `{from}`, `{to}`, `{fix}`, `{prev}` and `{lost}` are filled in.

Partial<Record<RolloutIssue["kind"], string>>—
fixLabels

One-tap fix labels. `{fix}` and `{prev}` are filled in.

Partial<Record<"jump" | "ahead", string>>—
armedText

Shown once the save button is armed.

string"Click again to save anyway."
saveLabel

Save button text.

string"Save rollout"
savedLabel

Shown after saving.

string"Saved"
savingLabel

Save label while onValueChange is pending.

string"Saving…"
productionLabel

Badge on production environments.

string"prod"
confirmLabel

Save label when there are warnings. `{count}` is filled in.

string"Save with {count} warnings"
discardLabel

Text for discarding changes.

string"Discard"
reachText

Readback templates. `{who}`, `{count}` and `{total}` are filled in.

string"{who} ≈ {count} of {total} users"
nobodyText

Readback when nobody gets the flag.

string"Nobody gets this flag."
everyoneText

Readback when everyone gets the flag.

string"Everyone ({total} users)"
restText

Joins segments and the percentage in the readback, e.g. "{segments} + {percent}% of everyone else".

string"{percent}% of everyone else"

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Feature Flag Rollout accessible?

  • Each environment is a fieldset with a legend; the slider has a <label> and an aria-valuetext readback
  • Segments are a labelled group of aria-pressed toggles
  • Warnings are aria-live="polite"; save status uses role="status"

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Enforce rollout rules and approvals in the flag service, and keep an audit log of changes.

  • User counts come from the segment sizes you pass
  • Saving runs your callback; the flag service decides real exposure

What expensive mistakes does Feature Flag Rollout stop?

Feature flag released to everyone early

Also known as

feature flag · rollout · percentage rollout · canary · launchdarkly · kill switch · ramp · segments

Field type

What dependencies does Feature Flag Rollout require?

Feature Flag Rollout facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameFeature Flag Rollout
Registry identifier@bollard/feature-flag-rollout
Install commandnpx shadcn@latest add @bollard/feature-flag-rollout
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Feature Flag Rollout

How does Feature Flag Rollout protect destructive mutations?

Feature Flag Rollout prevents feature flag released to everyone early. Enforces deliberate friction against Production rollouts that skip ramp steps, Production ahead of staging, Who actually gets the flag, counted in users, How many users lose the feature on a pullback. Limitation: authorize feature-flag-rollout mutations on the server.

How do I install feature-flag-rollout with shadcn?

Run `npx shadcn@latest add @bollard/feature-flag-rollout`. Sources added: registry/default/feature-flag-rollout/feature-flag-rollout.tsx. Package requirements: lucide-react.

What props customize Feature Flag Rollout?

Feature Flag Rollout accepts `environments`, `segments`, `value`, `defaultValue`, `defaultDraft`. Configures feature flag, rollout, percentage rollout behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of feature-flag-rollout?

User counts come from the segment sizes you pass. Saving runs your callback; the flag service decides real exposure Server requirement: Enforce rollout rules and approvals in the flag service, and keep an audit log of changes.

How does Feature Flag Rollout meet accessibility guidelines?

Each environment is a fieldset with a legend; the slider has a <label> and an aria-valuetext readback. Segments are a labelled group of aria-pressed toggles. Warnings are aria-live="polite"; save status uses role="status". Minimizes errors: flag rolled out to 100 percent, skipped staging rollout.

Which components pair with Feature Flag Rollout?