# API keys

A project's API keys, masked, with created and last-used dates, a create button and a confirmed revoke. PlankUI component for React 19 and Tailwind CSS v4. Category: Blocks.

## Install

```bash
npx plankui@latest add api-keys
```

## Usage

```tsx
import { ApiKeys } from "@/components/ui/api-keys";

<ApiKeys keys={keys} onCreate={createKey} onRevoke={revokeKey} />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| keys | `{ id, name, last4, prefix?, created, lastUsed? }[]` | `required` | The keys, shown masked. |
| onCreate | `() => void` |  | Shows the Create key button. |
| onRevoke | `(id: string) => void` |  | Called after the visitor confirms. |

Source: https://github.com/VectorLabsHQ/plankui/blob/main/components/ui/api-keys.tsx
