Magoo Component UI logo Magoo Component UI
← Catalog

API Key Card

api-key-card molecule experimental

A card that displays an API key masked, with reveal, copy, and rotate actions plus scope and created meta.

Also in: Cards

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

API key

Full access
mk_demo_************9f2a

Created Jan 12, 2026

ReadOnly

API key

Read only
mk_demo_************2b7c

Created Mar 3, 2026

Props

NameTypeReq
key string ✓
masked string ✓
scope string
created string

Related components

How to use

The masked and real values are carried on the value element's data-masked and data-key attributes, so the card renders masked with no JavaScript (and in screenshots). behavior.js wires the reveal toggle (swaps the field text and the eye icon and updates aria-pressed), the copy button (calls navigator.clipboard.writeText with the real key and shows "Copied!"), and the rotate button (fires a bubbling apikey:rotate event the host page listens for to mint a new key and re-render). The portable self-init reads everything from the DOM - no props object is passed.

Use cases

card WCAG AA SEO 20 dir: ltr ai-generated