Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

API Key Row

ProNew

A secret in a list: masked with its prefix and last four characters, with reveal, copy, and rotate and revoke that each ask for a second press.

Installation

pnpm dlx shadcn@latest add @viewport/api-key-row

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
name*string

What the key is for, e.g. "Production server".

—
value*string

The full key. It is shown masked until revealed.

—
createdstring

When it was made and last used, already formatted.

—
lastUsedstring—
onRotate() => void

Replaces the key. The button asks for a second press first.

—
onRevoke() => void

Deletes the key. The button asks for a second press first.

—
classNamestring—

Accessibility

  • Hidden keys are read as “Key ending in”, not as a row of bullets.
  • Reveal is a toggle with aria-pressed; copy confirms and is announced.
  • Rotate and revoke state what the second press will do, and disarm when focus leaves.
  • Respects prefers-reduced-motion.