Create, roll and revoke API keys with scopes, usage, stale warnings and a show-once secret.
Import it and pass your content. The props that matter most are listed next.
import { ApiKeys, type ApiKey } from "@/components/ui/notchset/blocks/api-keys";
export function Keys({ keys }: { keys: ApiKey[] }) {
return (
<ApiKeys
keys={keys}
scopes={[{ value: "runs:read" }, { value: "runs:write" }, { value: "deploy:prod", danger: true }]}
onCreate={async (draft) => {
const r = await fetch("/api/keys", { method: "POST", body: JSON.stringify(draft) });
if (!r.ok) throw new Error("create failed");
return r.json(); // { key, secret }
}}
onRoll={(key) => fetch(`/api/keys/${key.id}/roll`, { method: "POST" }).then((r) => r.json())}
onRevoke={(key) => fetch(`/api/keys/${key.id}`, { method: "DELETE" })}
/>
);
}keys–
{ id, name, env, suffix, scopes, lastUsed, stale?, created, requests, restriction, expiry, expiringSoon? }[]Only the last four characters of a secret reach the client. requests is 14 daily counts.
scopes–
{ value, danger? }[]The scopes to offer; danger ones turn signal when picked.
onCreate–
({ name, env, scopes, expiry }) => Promise<{ key, secret }>Create on your server; the secret is shown once and dropped on DONE.
onRoll / onRevoke–
(key) => Promise<key> / (key) => PromiseRoll resolves with the updated key; revoke is confirmed inline first.
expiries / note–
string[] / ReactNodeExpiry choices (default 30 D, 90 D, NEVER) and the line under the title.
ApiKeysdata-slot="api-keys"
The header, the create panel and the LIVE and TEST groups.
components/ui/notchset/blocks/api-keys.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.
pnpm dlx shadcn@latest add @beautiful-ui-pro/api-keysNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Give your coding assistant the Markdown guide instead of screenshots.
https://beautiful-ui.dev/api/mcp (setup)v1.0.0 · 2026-10-04
First release
Pro is in early access.