honestui

Secret Row

Dashboards

About

Show an API key or secret masked, and let people reveal, copy, rotate, or revoke it.

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

Code

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

Usage.tsx

"use client"
import "honestui/theme.css";

import * as React from "react"

import {
  SecretList,
  SecretRow,
  type SecretRowSecret,
} from "@/components/ui/honest-secret-row"

const now = Date.parse("2026-11-26T15:00:00Z")
const day = 24 * 60 * 60 * 1000

/**
 * Keys the page can only describe: the server never returns their values,
 * so there is no Show or Copy. Rotation fails the first time it is tried.
 */
const sampleKeys: SecretRowSecret[] = [
  {
    id: "whsec_billing",
    name: "Billing webhook",
    prefix: "whsec_",
    last4: "8b1c",
    createdAt: now - 380 * day,
    lastUsedAt: now - 12 * day,
    scopes: ["invoice.paid", "invoice.failed"],
  },
  {
    id: "key_legacy",
    name: "Legacy importer",
    prefix: "hk_live_",
    last4: "a4e0",
    createdAt: now - 720 * day,
    lastUsedAt: now - 95 * day,
    expiresAt: now - 4 * day,
  },
  {
    id: "key_contractor",
    name: "Contractor access",
    prefix: "hk_live_",
    last4: "5d77",
    createdAt: now - 160 * day,
    lastUsedAt: now - 60 * day,
    status: "revoked",
  },
]

function wait(milliseconds: number) {
  return new Promise((resolve) => window.setTimeout(resolve, milliseconds))
}

export default function SecretRowStates() {
  const attempts = React.useRef(0)

  return (
    <div data-theme="light">
      <SecretList aria-label="Webhook and legacy keys" className="max-w-xl">
        {sampleKeys.map((key) => (
          <SecretRow
            key={key.id}
            secret={key}
            now={now}
            onRotate={async (secret) => {
              await wait(800)
              attempts.current += 1
              if (attempts.current === 1) throw new Error("Rotation failed")
              return { value: `${secret.prefix ?? ""}Qm7Tz2LpX9cV4nB8wR1yK6hD3sF0` }
            }}
          />
        ))}
      </SecretList>
    </div>
  )
}

Dependencies

More by honestui

View all
  • Chromatic Text Reveal

    Chromatic Text Reveal

    30
  • Schedule Builder

    Schedule Builder

  • Audit Log

    Audit Log

  • Undoable Action

    Undoable Action

  • OTP Field

    OTP Field

  • Audio Orb

    Audio Orb

  • AI Glow Border

    AI Glow Border

  • Metaballs

    Metaballs

More in Dashboards

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    700
  • Analytics Dashboard

    Analytics Dashboard

    72
  • Insights Dashboard

    Insights Dashboard

    40
  • Creator Dashboard

    Creator Dashboard

    212
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    363
  • serf dashboard

    serf dashboard

    140
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.7K
  • Halden — CRM Dashboard with Sales Pipeline

    Halden — CRM Dashboard with Sales Pipeline

    58