Targeting rules for a feature flag, per environment: if beta and in Europe serve the new checkout, roll out to 10% of everyone else, fall back when it's off, and see who gets what across 2,000 simulated users while you edit.
akafeature flags·flag targeting·targeting rules
Powered by Qnot · the rules, matching and serialisation are Qnot; this is the UI on top.
Run this in any project set up for the shadcn CLI. It copies the Flag Targeting source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/flag-targeting.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { FlagTargeting } from "@/components/flag-targeting";
export default function Page() {
return <FlagTargeting />;
}A free React component in the Filters collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the Flag Targeting source. Everything is optional unless it says required.
| Prop | Type | Default |
|---|---|---|
| flagKeyrequired | string | — |
| flagNamerequired | string | — |
| fieldsrequired | Fields | — |
| variantsrequired | FlagVariant[] | — |
| environmentsrequired | FlagEnvironment[] | — |
| targetingrequired | Record<string, EnvironmentTargeting> | — |
| populationrequired | readonly Record<string, unknown>[] | — |
| onChange | (targeting: Record<string, EnvironmentTargeting>) => void | — |
| className | string | — |