Skip to content
nexubDesign System
v11.9.0

Components · Data Display

QR Code

AlphaAdded v10.9.0

A QR code as an SVG, always dark on light so it scans in every theme, with its value shown as text.

import { QRCode } from '@nexub/react';
View as Markdown

Playground

Props

https://example.com/h/4729
TSX
<QRCode value="https://example.com/h/4729" />

Examples

Default

https://example.com/h/4729

With a logo and a caption

example.com/h/4729

Props

Props
PropTypeDefaultDescription
valuerequiredstring—The text to encode, usually a URL. Up to 2,953 bytes of UTF-8 (1,273 with a logo).
sizestring | number160Width of the code: pixels, or any CSS length. It never grows past its container.
ecc'L' | 'M' | 'Q' | 'H''M', or 'H' with a `logo`Error correction: how much of the code may be damaged or covered (7%, 15%, 25%, 30%).
logoReact.ReactNode—A mark in the centre, on a light tile a fifth of the width.
quietZonenumber4Light margin around the code, in modules. Readers need 4.
labelstring'QR code for <value>'Text alternative of the image. The default is English: pass your own to translate it.
captionReact.ReactNode—The text under the code, so it can be read and typed without a camera. false hides it.