Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

QRCode

Create a QR code from an editable value.

Preview

Live preview

Changes apply to this preview only.

37 character(s) · UTF-8 byte mode

Why SVG?

A vector path stays sharp at any size, prints cleanly and needs no image pipeline.

  • Versions 1–10 cover roughly 271 bytes at level L and 119 bytes at level H.
  • Levels trade capacity for resilience: H survives more damage.
  • The quiet zone defaults to four modules and can be changed with margin.
  • No logo overlay: scanners are more reliable without one.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Error correction levels

The same payload at L, M, Q and H. Higher levels add Reed-Solomon codewords and can increase the version, but tolerate more damage.

Open preview

Colors and size

Keep a strong dark-on-light contrast for cameras. The light background is part of the symbol, so transparency is not recommended.

Open preview

Real-world payloads

A URL, a contact card and an email action all fit in a single code. The vCard is plain text with line breaks encoded as bytes.

Open preview

Usage

Validate the target destination and choose an appropriate size/error-correction level.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluQRCodeMatrix

Type source
PimoluQRCodeMatrix public API
NameTypeDefaultDescription
sizeRequirednumber160Edge length in modules, including no quiet zone.
versionRequirednumber—QR version, from 1 to 10.
maskRequirednumber—Mask applied to the data modules.
levelRequiredPimoluQRCodeLevel"M"Error correction level.
modulesRequiredboolean[][]—`modules[row][column]`, true for a dark module.
sizeRequired

number

Default: 160

Edge length in modules, including no quiet zone.

versionRequired

number

No default extracted.

QR version, from 1 to 10.

maskRequired

number

No default extracted.

Mask applied to the data modules.

levelRequired

PimoluQRCodeLevel

Default: "M"

Error correction level.

modulesRequired

boolean[][]

No default extracted.

`modules[row][column]`, true for a dark module.

PimoluQRCodeProps

Type source
PimoluQRCodeProps public API
NameTypeDefaultDescription
valueRequiredstring—Text encoded in byte mode as UTF-8. Must not be empty.
sizestring | number | undefined160Rendered width/height. Defaults to 160.
levelPimoluQRCodeLevel | undefined"M"Error correction level. Defaults to "M".
darkColorstring | undefined"#000000" for scanner reliabilityModule color. Defaults to "#000000" for scanner reliability.
lightColorstring | undefined"#ffffff"Background color. Defaults to "#ffffff".
marginnumber | undefined4 and is clamped to 0–16Quiet zone in modules. Defaults to 4 and is clamped to 0–16.
masknumber | undefined—Force a mask (0–7) instead of choosing the lowest-penalty one. Mostly useful to reproduce a reference encoder or to test determinism.
titlestring | undefined—Optional SVG `<title>` tooltip.
aria-labelstring | undefined`title`, then "QR code"Accessible name. Defaults to `title`, then "QR code".
classNamestring | undefined—Class applied to the `<svg>`.
styleCSSProperties | undefined—Inline style applied to the `<svg>`.
valueRequired

string

No default extracted.

Text encoded in byte mode as UTF-8. Must not be empty.

size

string | number | undefined

Default: 160

Rendered width/height. Defaults to 160.

level

PimoluQRCodeLevel | undefined

Default: "M"

Error correction level. Defaults to "M".

darkColor

string | undefined

Default: "#000000" for scanner reliability

Module color. Defaults to "#000000" for scanner reliability.

lightColor

string | undefined

Default: "#ffffff"

Background color. Defaults to "#ffffff".

margin

number | undefined

Default: 4 and is clamped to 0–16

Quiet zone in modules. Defaults to 4 and is clamped to 0–16.

mask

number | undefined

No default extracted.

Force a mask (0–7) instead of choosing the lowest-penalty one. Mostly useful to reproduce a reference encoder or to test determinism.

title

string | undefined

No default extracted.

Optional SVG `<title>` tooltip.

aria-label

string | undefined

Default: `title`, then "QR code"

Accessible name. Defaults to `title`, then "QR code".

className

string | undefined

No default extracted.

Class applied to the `<svg>`.

style

CSSProperties | undefined

No default extracted.

Inline style applied to the `<svg>`.

Accessibility

  • Always provide the encoded destination as readable text or a link, not only a visual code.
Read the accessibility guide →