themeocean

Feature Flag Rollout Card

Component

About

A control card for one feature flag with per-environment on/off switches, a percentage rollout slider and quick presets. It shows how many users are reached and tracks unsaved changes with Save and Reset.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Feature Flag Rollout Card to your project and fits it to your theme.

Code

How Feature Flag Rollout Card is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

// This is a file with a demo for your component
// That's what users will see in the preview
// Create new files in this directory to add more demos

"use client";

import * as React from "react";
import { Component, type RolloutEnvironment } from "@/components/ui/feature-flag-rollout-card";

const ENVIRONMENTS: RolloutEnvironment[] = [
  { id: "development", name: "Development", enabled: true, percentage: 100, users: 48 },
  { id: "staging", name: "Staging", enabled: true, percentage: 50, users: 320 },
  { id: "production", name: "Production", enabled: true, percentage: 10, users: 84200 },
];

export default function DemoOne() {
  const [last, setLast] = React.useState<string>("");

  return (
    <div className="flex min-h-[640px] w-full flex-col items-center justify-center gap-4 bg-background px-4 py-10 text-foreground">
      <Component
        flagName="New checkout flow"
        flagKey="checkout_v2"
        description="Shows the one-page checkout to a share of customers."
        environments={ENVIRONMENTS}
        onSave={(envs) => setLast(envs.map((e) => e.name + " " + (e.enabled ? e.percentage + "%" : "off")).join(" · "))}
      />
      {last && <p className="max-w-xl text-center text-xs text-muted-foreground">Saved: {last}</p>}
    </div>
  );
}

Dependencies

More by themeocean

View all
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    781
  • Floating Glassmorphic Navbar with Morphing Pill Indicator

    Floating Glassmorphic Navbar with Morphing Pill Indicator

    88
  • Mac-Style Floating Dock

    Mac-Style Floating Dock

    79
  • Nexus 3D Animated Login - Futuristic Authentication UI

    Nexus 3D Animated Login - Futuristic Authentication UI

    72
  • Animated 3D Perspective Hero with Floating Glass Layers

    Animated 3D Perspective Hero with Floating Glass Layers

    51
  • Interactive AI Agent Workflow Node Card

    Interactive AI Agent Workflow Node Card

    39
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    31
  • Interactive AI Voice Assistant Audio Visualizer

    Interactive AI Voice Assistant Audio Visualizer

    24