Skip to content
caliper ui docs

Pro

Feature flags

Feature flags across environments: switch each on or off, roll out to a percentage, target with rules, see stale flags, and confirm every production change with how many people it reaches.

Pro
pnpm dlx shadcn@latest add @caliper/feature-flags

Feature flags

4 flags · changes reach running apps within 30 seconds.

Feature flags by environment
FlagDevelopmentStagingProduction
25%
50%

Installs components/ui/feature-flags.tsxDepends on @radix-ui/react-dialog, @radix-ui/react-popover, @radix-ui/react-slot, lucide-reactMotion none in component source

When to use

Use it for

  • Release management and experimentation tools.
  • Internal admin for teams that ship behind flags.

Skip it when

  • A user preference; use a switch in settings.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/feature-flags

Adds its 12 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { FeatureFlags } from "@/components/ui/feature-flags"

The worked example comes with Pro

The 41-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

FeatureFlags

component
PropTypeDefaultDescription
flags *readonly FeatureFlag[]—
environments *readonly { id: string; name: string; production?: boolean | undefined; }[]—
attributesreadonly string[]["plan", "country", "email", "workspace"]What rules can match on.
monthlyUsersReadonly<Record<string, number>>—Active users per environment, to say how many people a rollout reaches.
onChange *(flag: FeatureFlag) => void | Promise<void>—
classNamestring—

Accessibility

It exposes region and status semantics, with aria-labelledby, aria-label, aria-expanded, aria-controls and aria-hidden kept in step with state. Changes that matter are announced through a live region.

Keyboard and focus handling comes from Radix dialog and popover: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Developer tools examples