Back to components
API Key Field React component

What is this?

A masked secret-key field: a key badge, the prefix and last four characters (sk_live_••••••••4242), a reveal toggle, and a copy button. Revealing blurs one layer into the other, and copying turns the icon into a check while “Copied” slides out beside it. Swap the key, label, and hint, then drop it into a developer settings or API keys page.

Component

API Key Field

A masked secret-key field: a key badge, the prefix and last four characters (sk_live_••••••••4242), a reveal toggle, and a copy button. Revealing blurs one layer into the other, and copying turns the icon into a check while “Copied” slides out beside it. Swap the key, label, and hint, then drop it into a developer settings or API keys page.

Checking access…
Live Preview

Verified Technical Spec

Animation
CSS / Tailwind
Reduced motion
Verified
Keyboard focus
Verified
Compatibility
Tailwind CSS v3.4 + v4 · React 19 / Next.js 15 App Router + Vite / Remix compatible

Included

  • Copy source into Cursor or Claude for agent install
  • Finished React · TypeScript · Tailwind CSS · Lucide UI

Dependencies

  • React 19.0.0
  • Typescript 5.7.2
  • Tailwindcss 3.4.16
  • Lucide-react 1.23.0

Tech Stack

  • React
  • TypeScript
  • Tailwind CSS
  • Lucide

Version 1.0.0