QRCode#

Renders a string as a scannable QR code, drawn with half-block cells.

Import#

TSX
import { QRCode } from '@sigx/terminal';

Usage#

TSX
/** @jsxImportSource @sigx/terminal */
import { component, defineApp, QRCode } from '@sigx/terminal';

const App = component(() => {
    return () => (
        <box border="single" label="Scan to open">
            <QRCode text="https://sigx.dev/terminal/" quiet={2} />
        </box>
    );
});

defineApp(<App />).mount({ clearConsole: true });

Props#

PropTypeNotes
textstringrequired — the data to encode
invertbooleanswap dark/light modules (for light terminals)
quietnumberquiet-zone border width in modules

The headless generateQR(text) helper produces the underlying matrix if you want to render it yourself.

See also#

  • Table — tabular data.