Experimental Badge

Experimental Badge is a copy-paste React component that stops trusted a beta feature and lost work 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/experimental-badge
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

StopsTrusted a beta feature and lost work

Was this component page useful?

How do I install Experimental Badge?

pnpm dlx shadcn@latest add @bollard/experimental-badge

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

How do I use Experimental Badge in React?

experimental-badge-usage.tsx
import { ExperimentalBadge } from "@/components/ui/experimental-badge"

<ExperimentalBadge
  feature="Smart inbox"
  defaultOpen
  risks={[
    {
      kind: "data",
      text: "Auto-sorted folders may be reset while we tune the model. Your emails are never deleted.",
    },
    { kind: "change", text: "Which emails count as “Important” will change week to week." },
  ]}
  feedbackHref="#feedback"
  switchBackNote="Your folders stay here for when you come back."
  onSwitchBack={() => new Promise<void>((resolve) => setTimeout(() => (setSmart(false), resolve()), 700))}
/>

What input mistakes does Experimental Badge catch?

  • Unclear risk of using an unfinished feature
  • No way back, by offering a switch to stable
  • What happens to work when switching back

What props does Experimental Badge accept?

ExperimentalBadge props
PropTypeDefault
feature* (required)

The feature's name, e.g. "Smart inbox".

string—
stage

How unfinished the feature is.

ExperimentStage"beta"
risks

What can go wrong, as concrete sentences. Defaults depend on `stage`.

ExperimentRisk[]DEFAULT_RISKS[stage]
feedbackHref

Where feedback goes: a form, an issue, a mailto.

string—
onFeedback

Or handle feedback yourself (open your widget).

() => void—
onSwitchBack

Turn the feature off and go back to the stable version. May return a promise.

() => void | Promise<void>—
switchBackNote

What happens to their work when they switch back, e.g. "Your 3 saved views stay here for when you return."

string—
open

Controlled open state of the panel.

boolean—
defaultOpen

Initial open state when uncontrolled.

booleanfalse
onOpenChange

Called when the panel opens or closes.

(open: boolean) => void—
label

Badge text. Defaults to the stage name.

stringstageLabels[stage]
heading

Panel heading; `{feature}` and `{stage}` are filled in.

string"{feature} is in {stage}"
feedbackLabel

Text for the feedback link.

string"Send feedback"
switchBackLabel

Text for the switch-back button.

string"Use stable version"
switchingLabel

Button text while switching back.

string"Switching…"
errorText

Shown when switching back fails.

string"Couldn’t switch back. Try again."

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

How is Experimental Badge accessible?

  • The badge is a button with aria-expanded and a descriptive aria-label
  • The panel is role="dialog" with an aria-label
  • Switch-back errors use role="alert"

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

What are the limitations and server boundaries?

  • Lists the risks you write; it can't know them
  • Switching back runs your onSwitchBack

What expensive mistakes does Experimental Badge stop?

Trusted a beta feature and lost work

Also known as

beta · experimental · labs · preview · feature flag · early access · badge · opt out

What dependencies does Experimental Badge require?

Experimental Badge facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameExperimental Badge
Registry identifier@bollard/experimental-badge
Install commandnpx shadcn@latest add @bollard/experimental-badge
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 Experimental Badge

What form validation mistake does Experimental Badge catch?

Experimental Badge prevents trusted a beta feature and lost work. A badge that opens the concrete risks of a beta feature and a one-tap way back to the stable version, so people don't trust it blindly. Catches: Unclear risk of using an unfinished feature, No way back, by offering a switch to stable, What happens to work when switching back. Limitation: validate experimental-badge schemas on backend.

How do I install experimental-badge with shadcn?

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

What props customize Experimental Badge?

Experimental Badge accepts `feature`, `stage`, `risks`, `feedbackHref`, `onFeedback`. Configures beta, experimental, labs behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of experimental-badge?

Lists the risks you write; it can't know them. Switching back runs your onSwitchBack Server requirement: backend verification for experimental-badge.

How does Experimental Badge meet accessibility guidelines?

The badge is a button with aria-expanded and a descriptive aria-label. The panel is role="dialog" with an aria-label. Switch-back errors use role="alert". Minimizes errors: beta feature lost data, experimental feature risks.

Which components pair with Experimental Badge?