Skip to content
Calm motion: animations on this site only fade, with no movement

API key field ​

A secret key, hidden by default, with show, copy, and make a new key

Shows a secret key on a settings page, so a person can copy it into an app. The key is hidden until the person asks to see it. For a password that a person types, use the password input.

Basic

Upload script

sk_demo_ … cD5f

Made 3 Nov 2026 · Last used 2 hours ago

  • value is the key. While it is hidden, only its start, such as sk_demo_, and its last four letters show. Screen readers hear the same short form.
  • The eye button shows or hides the full key. It is a toggle with aria-pressed.
  • "Copy" copies the full key, also while it is hidden, and emits copy. A hidden status line says "Copied".
  • "Make a new key" opens a confirm popup that says the old key stops working. Only the confirm emits regenerate. Make the new key on your server, then set value. :regenerable="false" hides this button.
  • name, created, and last-used add the name of the key and two dates, as text.
  • Change the words with labels or a label pack: show, hide, copy, copied, regenerate, confirm, confirmLabel, cancel, and created and lastUsed (functions of the date).

Usage ​

ts
import { BlessApiKeyField } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
value*string—the secret key
namestring—the name of the key, for example "Upload script"
createdstring—when the key was made, as text
lastUsedstring—when the key was last used, as text
regenerablebooleantrueshow the button that makes a new key; false hides it
labelsPartial<{ show: string; hide: string; copy: string; copied: string; regenerate: string; confirm: string; confirmLabel: string; cancel: string; created: (when: string) => string; lastUsed: (when: string) => string; }>—

Events

NamePayloadDescription
copy[]
regenerate[]

Released under the MIT License. Character names and artwork belong to their owners.