terra vidhal

Api Key Vault

Component

About

An API credential vault with searchable keys, status filters, scoped creation, secret reveal and copy, rotation, revocation with undo, protected audit activity and complete keyboard and screen-reader labelling.

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

Code

How Api Key Vault is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import {
  ApiKeyVault,
  type ApiKeyRecord,
  type ApiScope,
} from "@/components/ui/api-key-vault";

const SCOPES: ApiScope[] = [
  { id: "projects:read", label: "Read projects", group: "Projects" },
  { id: "projects:write", label: "Manage projects", group: "Projects" },
  { id: "reports:read", label: "Read reports", group: "Analytics" },
  { id: "reports:export", label: "Export reports", group: "Analytics" },
  { id: "billing:read", label: "Read invoices", group: "Billing" },
  { id: "billing:manage", label: "Manage billing", group: "Billing", critical: true },
  { id: "team:read", label: "Read members", group: "Team" },
  { id: "team:invite", label: "Invite members", group: "Team" },
  { id: "keys:manage", label: "Manage API keys", group: "Admin", critical: true },
];

const KEYS: ApiKeyRecord[] = [
  {
    id: "key-checkout",
    name: "Checkout service",
    prefix: "pk_live_checkout",
    secret: "pk_live_checkout_9f3c2b7a41d84e60b5a2",
    scopes: ["projects:read", "reports:read", "billing:read"],
    createdAt: "Sep 4, 2026",
    lastUsed: "4 minutes ago",
    status: "active",
    expiresAt: "in 62 days",
  },
  {
    id: "key-analytics",
    name: "Analytics export",
    prefix: "pk_live_analytics",
    secret: "pk_live_analytics_c81f6e0a2b7d4391ac54",
    scopes: ["projects:read", "reports:read", "reports:export"],
    createdAt: "Jun 21, 2026",
    lastUsed: "yesterday",
    status: "expiring",
    expiresAt: "in 9 days",
  },
  {
    id: "key-webhook",
    name: "Legacy webhook",
    prefix: "pk_live_legacy",
    secret: "pk_live_legacy_2a9d4c6e8f1b3057d2c9",
    scopes: ["projects:read", "team:read"],
    createdAt: "Jan 8, 2026",
    lastUsed: "3 weeks ago",
    status: "revoked",
  },
];

export default function ApiKeyVaultDemo() {
  return (
    <main className="flex min-h-screen w-full items-center justify-center bg-background px-4 py-12 sm:px-6">
      <ApiKeyVault
        initialKeys={KEYS}
        scopes={SCOPES}
        title="Workspace API keys"
        description="Three credentials for the workspace. Reveal a secret only when needed, rotate it after a leak and revoke anything left behind."
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Gravity Stars Background

    Gravity Stars Background

    16
  • Audio Waveform

    Audio Waveform

    13
  • Topographic Lines

    Topographic Lines

    12
  • Notification Center

    Notification Center

    11
  • Booking Calendar

    Booking Calendar

    10
  • Spotlight Card

    Spotlight Card

    10
  • Command Palette

    Command Palette

    9
  • Kpi Counter

    Kpi Counter

    9

Explore more

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