Skip to content

Data display

QR code

A QR code a phone scans: an authenticator's set-up, a link to open on another device.

Installation

Terminal
pnpm add @elsikora/keystone-ui-kit

Usage

Import
import { QrCode } from "@elsikora/keystone-ui-kit";
docs/qr-code/default.example.tsx
import { QrCode } from "@elsikora/keystone-ui-kit";
export default function QrCodeDefaultExample() {  return <QrCode text="https://keystone.example/docs" label="Open the docs on your phone" />;}

Examples

Default

With its text

The same content as text beside the code, for a person who cannot scan it.

Or type this key
JBSWY3DPEHPK3PXP

API reference

QrCode

PropTypeDefaultDescription
textstring-What the code holds: a link, an otpauth:// address.
labelstring-The image's accessible name.
sizenumber192Width and height in CSS pixels.

Notes

  • It is an image named by label: say what scanning it does, not the text it holds.
  • Always give the text another way too (as the authenticator's key beside the code).
  • Dark on light in both themes, with the standard quiet zone of four modules drawn in.