Skip to content
NewYour data: charts, lists and meters that take your records
<px-secret>Custom elementMoments

Secret field

API key field hidden under crawling pixel noise; holding the eye wipes the noise away and each character decodes before it locks.

View as Markdown
<px-secret>

Your data

Pass your key as value. Without it the field shows a fake demo key. See Your data.

Playground

Change a prop and the component updates. Props marked live animate to the new value; the others rebuild the element.

Loading <px-secret>
Props
valuelive
<PxSecret value="sk-demo-4f9Q7xLm2Rk8Vt3nW6pA" />

Installation

pnpm dlx shadcn@latest add @lumesec/px-secret
First timeRegister the @lumesec registry once, or install by URL

Adds @lumesec to your components.json:

pnpm dlx shadcn@latest registry add @lumesec=https://elements.lumesec.ai/r/{name}.json

Or skip the setup and install by URL:

npx shadcn@latest add https://elements.lumesec.ai/r/px-secret.json

Usage

import { PxSecret } from "@/components/lumesec/px-secret";

export function Example() {
  return (
    <PxSecret />
  );
}

Behaviour

The key hides under crawling pixel noise. Holding the eye wipes the noise away behind a dithered edge while each character decodes through random glyphs before it locks. Let go and it scrambles shut. The key shown is a fake.

API reference

Attributes

valueReact propvalueTypestringDefaultsk-demo-4f9Q7xLm2Rk8Vt3nW6pA

The key to display and copy. Changing it rebuilds the characters; the copy button reads the attribute at click time.

Properties

valueTypestring

The key to display and copy; reflects the value attribute, or the demo key when it is missing.

Keyboard

KeysAction
Space / Enter (on the eye button)Reveal while held; releasing the key or moving focus away hides it again.

Accessibility

  • The eye button has aria-label="Hold to reveal the key" and aria-pressed reflecting whether it is held.
  • The copy button has aria-label="Copy the key".
  • The key container is a role="group" with aria-label="API key, hidden", which changes to include the key once it is fully revealed. The characters and the noise are aria-hidden, and hidden characters are not rendered, so the key cannot be read or selected before it is revealed.
  • The hint line below is an aria-live="polite" region that reports copy success or failure.
  • Reduced motion: the key reveals and hides at once, characters appear without the scramble and the noise layer holds still.

Theming

The element reads your shadcn theme tokens through its shadow root, so light and dark follow your theme. The accent comes from --lumesec. See Theming.

This component reads --border, --card, --foreground, --lumesec and --muted-foreground.

To restyle only LumeSec elements, set the matching --ui-* overrides: --ui-accent, --ui-border, --ui-fg, --ui-mono, --ui-muted and --ui-surface.

Notes

  • The default value is a fake demo key. The key is part of the page: it is hidden from view, not encrypted.
  • Copy uses navigator.clipboard.writeText; when that is unavailable the hint asks the user to reveal and copy by hand.
  • The key stays visible for 0.35 seconds after release before it scrambles shut. The label text "API key" is fixed.

Was this page helpful?