Aashir Zayd

Demo Shield

Component 7

About

1 of 1 — Demo Shield: one hotkey redacts emails, cards, API keys, phones, money & names on screen before you share it. Overlay-based, zero DOM mutation, scroll-aware, hold ⌥ to peek.

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

Code

How Demo Shield is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import { DemoShield } from "@/components/ui/demo-shield";

const CUSTOMERS = [
  { name: "Maya Lindqvist", email: "maya@northpine.studio", phone: "+46 70 123 4567", plan: "Scale", ltv: "$18,420.00", status: "Active" },
  { name: "Dev Raghunathan", email: "dev.r@orbitkit.io", phone: "+91 98450 12345", plan: "Pro", ltv: "₹6,82,000", status: "Active" },
  { name: "Lena Okafor", email: "lena.okafor@hollowmail.com", phone: "(415) 555-0142", plan: "Pro", ltv: "$4,980.50", status: "Past due" },
  { name: "Tomás Vidal", email: "tomas@vidal-and-co.es", phone: "+34 612 34 56 78", plan: "Starter", ltv: "€1,240.00", status: "Trial" },
  { name: "Hana Sato", email: "hana.sato@kumo.dev", phone: "+81 90 1234 5678", plan: "Scale", ltv: "$22,310.75", status: "Active" },
];

const LOGS = [
  { t: "14:02:11", ev: "charge.succeeded", ip: "84.17.42.190", amt: "$249.00" },
  { t: "14:01:57", ev: "invoice.payment_failed", ip: "102.89.4.77", amt: "$129.00" },
  { t: "13:59:30", ev: "customer.updated", ip: "49.207.33.12", amt: "—" },
];

function Pill({ s }: { s: string }) {
  const c = s === "Active" ? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400" : s === "Past due" ? "bg-rose-500/10 text-rose-700 dark:text-rose-400" : "bg-amber-500/10 text-amber-700 dark:text-amber-400";
  return <span className={"inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium " + c}>{s}</span>;
}

export default function Demo() {
  const [q, setQ] = React.useState("lena.okafor@hollowmail.com");
  const [reveal, setReveal] = React.useState(false);
  return (
    <div className="flex min-h-screen w-full items-center justify-center bg-[#e9e7e1] p-3 dark:bg-[#0a0a0a] sm:p-6">
      <DemoShield
        defaultActive
        words={CUSTOMERS.flatMap((c) => [c.name, c.name.split(" ")[0]])}
        className="w-full max-w-[1180px] rounded-[20px] border border-black/10 bg-white text-neutral-900 shadow-[0_30px_80px_-30px_rgba(0,0,0,.35)] dark:border-white/10 dark:bg-[#111] dark:text-neutral-100"
        style={{ height: "min(860px, calc(100vh - 24px))" }}
      >
        {/* presenting bar */}
        <div className="flex h-[60px] items-center justify-between border-b border-black/5 px-4 dark:border-white/5" data-shield-ignore="">
          <div className="flex items-center gap-2 text-[12px]">
            <span className="relative flex h-2 w-2">
              <span className="absolute inset-0 animate-ping rounded-full bg-rose-500 opacity-60" />
              <span className="relative h-2 w-2 rounded-full bg-rose-500" />
            </span>
            <span className="hidden font-medium sm:inline">You're presenting</span>
            <span className="font-medium sm:hidden">Live</span>
            <span className="hidden text-neutral-500 md:inline">· Q4 billing review · 48 watching</span>
          </div>
          <span className="hidden rounded-full bg-rose-600 px-3 py-1 text-[12px] font-medium text-white sm:inline">Stop presenting</span>
        </div>

        <div className="h-[calc(100%-60px)] overflow-y-auto px-4 pb-28 pt-5 sm:px-7">
          {/* app header */}
          <div className="flex flex-wrap items-center gap-3">
            <div className="flex items-center gap-2">
              <div className="grid h-8 w-8 place-items-center rounded-[9px] bg-neutral-900 text-[13px] font-semibold text-white dark:bg-white dark:text-neutral-900">L</div>
              <div>
                <div className="text-[15px] font-semibold tracking-[-0.01em]">Ledgerly</div>
                <div className="text-[11px] text-neutral-500">Billing · Production</div>
              </div>
            </div>
            <div className="ml-auto flex w-full items-center gap-2 sm:w-auto">
              <input
                value={q}
                onChange={(e) => setQ(e.target.value)}
                placeholder="Search customers"
                aria-label="Search customers"
                className="h-9 w-full rounded-[10px] border border-black/10 bg-neutral-50 px-3 text-[13px] outline-none focus:border-neutral-400 dark:border-white/10 dark:bg-white/5 sm:w-[280px]"
              />
            </div>
          </div>

          {/* kpis */}
          <div className="mt-5 grid grid-cols-2 gap-3 lg:grid-cols-4">
            {[
              ["MRR", "$48,210.55", "+6.2%"],
              ["Next payout", "$12,904.10", "Fri"],
              ["Failed charges", "$1,380.00", "7 invoices"],
              ["Customers", "1,284", "+38 this week"],
            ].map(([k, v, s]) => (
              <div key={k} className="rounded-[14px] border border-black/5 bg-neutral-50/70 p-4 dark:border-white/5 dark:bg-white/[0.03]">
                <div className="text-[12px] text-neutral-500">{k}</div>
                <div className="mt-1 text-[22px] font-semibold tabular-nums tracking-[-0.02em]">{v}</div>
                <div className="mt-0.5 text-[11px] text-neutral-500">{s}</div>
              </div>
            ))}
          </div>

          <div className="mt-4 grid gap-4 lg:grid-cols-[1.6fr_1fr]">
            {/* customers */}
            <div className="overflow-hidden rounded-[14px] border border-black/5 dark:border-white/5">
              <div className="flex items-center justify-between px-4 py-3">
                <div className="text-[13px] font-semibold">Customers</div>
                <div className="text-[11px] text-neutral-500">Sorted by LTV</div>
              </div>
              <div className="overflow-x-auto">
                <table className="w-full min-w-[620px] text-left text-[13px]">
                  <thead className="text-[11px] uppercase tracking-[.06em] text-neutral-500">
                    <tr className="border-t border-black/5 dark:border-white/5">
                      <th className="px-4 py-2 font-medium">Customer</th>
                      <th className="px-4 py-2 font-medium">Phone</th>
                      <th className="px-4 py-2 font-medium">Plan</th>
                      <th className="px-4 py-2 text-right font-medium">LTV</th>
                    </tr>
                  </thead>
                  <tbody>
                    {CUSTOMERS.map((c) => (
                      <tr key={c.email} className="border-t border-black/5 dark:border-white/5">
                        <td className="px-4 py-2.5">
                          <div className="flex items-center gap-2.5">
                            <div data-shield="name" className="grid h-7 w-7 shrink-0 place-items-center rounded-full bg-gradient-to-br from-neutral-200 to-neutral-300 text-[11px] font-semibold text-neutral-700 dark:from-neutral-700 dark:to-neutral-800 dark:text-neutral-200">
                              {c.name.split(" ").map((p) => p[0]).join("")}
                            </div>
                            <div className="min-w-0">
                              <div className="font-medium">{c.name}</div>
                              <div className="text-[12px] text-neutral-500">{c.email}</div>
                            </div>
                          </div>
                        </td>
                        <td className="whitespace-nowrap px-4 py-2.5 tabular-nums text-neutral-600 dark:text-neutral-400">{c.phone}</td>
                        <td className="px-4 py-2.5">
                          <div className="flex items-center gap-2">
                            {c.plan} <Pill s={c.status} />
                          </div>
                        </td>
                        <td className="px-4 py-2.5 text-right tabular-nums">{c.ltv}</td>
                      </tr>
                    ))}
                  </tbody>
                </table>
              </div>
            </div>

            <div className="flex flex-col gap-4">
              {/* support thread */}
              <div className="rounded-[14px] border border-black/5 p-4 dark:border-white/5">
                <div className="flex items-center justify-between">
                  <div className="text-[13px] font-semibold">Support · #4821</div>
                  <div className="text-[11px] text-neutral-500">2m ago</div>
                </div>
                <div className="mt-3 space-y-2 text-[13px] leading-relaxed">
                  <div className="max-w-[92%] rounded-[12px] rounded-tl-[4px] bg-neutral-100 px-3 py-2 dark:bg-white/5">
                    Hi, my card 4242 4242 4242 4242 keeps getting declined. Can you charge it manually? Reach me at lena.okafor@hollowmail.com
                  </div>
                  <div className="ml-auto max-w-[85%] rounded-[12px] rounded-tr-[4px] bg-neutral-900 px-3 py-2 text-white dark:bg-white dark:text-neutral-900">
                    Never send card numbers in chat, Lena. I've sent a secure link to update it.
                  </div>
                </div>
              </div>

              {/* api keys */}
              <div className="rounded-[14px] border border-black/5 p-4 dark:border-white/5">
                <div className="flex items-center justify-between">
                  <div className="text-[13px] font-semibold">API keys</div>
                  <button type="button" onClick={() => setReveal((r) => !r)} className="text-[11px] text-neutral-500 underline-offset-2 hover:underline">
                    {reveal ? "Hide" : "Reveal"}
                  </button>
                </div>
                <div className="mt-3 space-y-2 font-mono text-[12px]">
                  <div className="flex items-center justify-between gap-3 rounded-[9px] bg-neutral-50 px-3 py-2 dark:bg-white/[0.03]">
                    <span className="shrink-0 text-neutral-500">Secret</span>
                    <span className="truncate">{reveal ? "sk_live_51NfQ8aLx2Rm7VdKp9TzW" : "sk_live_51NfQ8a••••••••"}</span>
                  </div>
                  <div className="flex items-center justify-between gap-3 rounded-[9px] bg-neutral-50 px-3 py-2 dark:bg-white/[0.03]">
                    <span className="shrink-0 text-neutral-500">Webhook</span>
                    <span className="truncate">whsec_7HqP2mXvL9cTn4Rb</span>
                  </div>
                </div>
              </div>
            </div>
          </div>

          {/* logs */}
          <div className="mt-4 rounded-[14px] border border-black/5 p-4 dark:border-white/5">
            <div className="text-[13px] font-semibold">Webhook log</div>
            <div className="mt-2 divide-y divide-black/5 font-mono text-[12px] dark:divide-white/5">
              {LOGS.map((l) => (
                <div key={l.t} className="flex flex-wrap items-center gap-x-4 gap-y-1 py-2">
                  <span className="text-neutral-500">{l.t}</span>
                  <span className="min-w-[180px]">{l.ev}</span>
                  <span className="text-neutral-500">from {l.ip}</span>
                  <span className="ml-auto tabular-nums">{l.amt}</span>
                </div>
              ))}
            </div>
          </div>

          <p className="mt-5 text-center text-[11px] text-neutral-500" data-shield-ignore="">
            1 of 1 · Press ⌘⇧H to arm · hold ⌥ over a mask to peek · type an email in the search box
          </p>
        </div>
      </DemoShield>
    </div>
  );
}

More by Aashir Zayd

View all
  • Uptime Pet

    Uptime Pet

    50
  • Card Fan

    Card Fan

    44
  • Creator Dashboard

    Creator Dashboard

    38
  • Venue Ticketing

    Venue Ticketing

    36
  • Dot Matrix Toaster

    Dot Matrix Toaster

    32
  • Punch Card Input

    Punch Card Input

    31
  • Container Loader

    Container Loader

    27
  • Commit Bonsai

    Commit Bonsai

    27

Explore more

Part of MouseUI — browse the full library on 21st.dev.