vamsiy78

API Key Field

Component

About

A field for displaying a secret like an API key, masked by default with a reveal toggle, a copy-to-clipboard button, and an optional regenerate action.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds API Key Field to your project and fits it to your theme.

Code

How API Key Field is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { ApiKeyField } from "@/components/ui/api-key-field";

export default function ApiKeyFieldDemo() {
  return (
    <ApiKeyField
      className="w-full max-w-md"
      label="Secret key"
      description="Created Sep 28, 2026. Keep it on your server."
      value="sk-live-7f3a9c1e5b2d4f6a8c0e2b4d6f8a1c3e5b7d9fa1b2"
      visiblePrefix={8}
      visibleSuffix={4}
      onRegenerate={() => {}}
    />
  );
}

Dependencies

More by vamsiy78

View all
  • Segmented Control

    Segmented Control

    7
  • HUD

    HUD

  • Border Beam

    Border Beam

  • Bar List

    Bar List

  • Agent Roster

    Agent Roster