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"
// A fixed clock, so the relative times read the same on every visit.
const now = Date.parse("2026-11-26T15:00:00Z")
const hour = 60 * 60 * 1000
const day = 24 * hour
const sampleKeys: SecretRowSecret[] = [
{
id: "key_prod",
name: "Production server",
prefix: "hk_live_",
last4: "3f9a",
createdAt: now - 214 * day,
lastUsedAt: now - 2 * 60 * 1000,
scopes: ["orders:read", "orders:write", "refunds:write"],
},
{
id: "key_ci",
name: "CI pipeline",
prefix: "hk_live_",
last4: "c07e",
createdAt: now - 41 * day,
lastUsedAt: now - 5 * hour,
expiresAt: now + 49 * day,
scopes: ["orders:read"],
},
{
id: "key_local",
name: "Local development",
prefix: "hk_test_",
last4: "91d2",
createdAt: now - 3 * day,
lastUsedAt: null,
scopes: ["orders:read", "customers:read"],
},
]
/** Stand-in for the server: values are made up here and only handed over on request. */
const values: Record<string, string> = {
key_prod: "hk_live_4eC39HqLyjWDarjtT1zdp7dc3f9a",
key_ci: "hk_live_9vNq2RkPz7uYbXm3TgLs0hWfc07e",
key_local: "hk_test_Fh2kLp9QzRm4WnYt7Vb1xJe891d2",
}
function wait(milliseconds: number) {
return new Promise((resolve) => window.setTimeout(resolve, milliseconds))
}
// New values for this preview. A server would generate them.
const replacements = [
"Qm7Tz2LpX9cV4nB8wR1yK6hD3sF0",
"aT5gYw8Jc2Nd6RkE9uHq4ZxM7pV1",
"Lb3Sv6Wf1Kj9PzC4mXe8QyU2tGh5",
]
export default function SecretRowDemo() {
const rotations = React.useRef(0)
return (
<div data-theme="light">
<SecretList aria-label="API keys" className="max-w-xl">
{sampleKeys.map((key) => (
<SecretRow
key={key.id}
secret={key}
now={now}
onReveal={async (secret) => {
await wait(350)
return values[secret.id] ?? ""
}}
onRotate={async (secret) => {
await wait(900)
const tail = replacements[rotations.current % replacements.length]
rotations.current += 1
const value = `${secret.prefix ?? ""}${tail}`
values[secret.id] = value
return { value }
}}
onRevoke={() => wait(700)}
/>
))}
</SecretList>
</div>
)
}
















