Skip to content

QR Code

New

A QR code that a phone camera reads, for a link, a Wi-Fi login, or short text. It can hold your logo and show the link with a Copy button.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 17, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

The value is the text in the code: a link or any text. Give a value that is not an http(s) link a label, because the default name does not read it aloud.

share-project.tsx

QrCode

<figure>
PropTypeDefaultDescription
aria-labelstring—Defines a string value that labels the current element. The accessible name. Default "QR code", or "QR code: <value>" for an http(s) link: other payloads are noise read aloud, and some hold secrets (a Wi-Fi password, an otpauth:// key).
valueRequiredstring—The text in the code: a link, a Wi-Fi payload (wifiPayload in #/lib/qr-payload), any text.
pixelSizenumber160The outer width in px, quiet zone included. Default 160.
level"H""L""M""Q"—The error correction level: L 7%, M 15% (default), Q 25%, H 30% of the code can be lost. A logo always sets H.
module"dots""rounded""square""square"The shape of the data modules. Default square.
finder"circle""rounded""square""square"The shape of the three finder patterns. Default square.
platebooleantrueThe light plate under the code. Default true.
status"empty""error""loading""ready""ready"The load state. Default ready. loading: the skeleton while the value is not known yet. empty: the empty box. error shows as ready: the error box is for a value the code cannot hold.
animateInbooleanfalseSweeps the modules in when the code mounts in the browser. Default false.
labelsPartial<CodeSymbolLabels>—The texts of the empty and error states.
onError—Runs when etiket cannot encode the value, with the kind and the message.
...props<figure> attributes—Every other attribute goes to the <figure>, with a ref.

QrCodeImage

<div>
PropTypeDefaultDescription
childrenReactNode—A QrCodeLogo: its box is cleared in the center of the code.
logoSizenumberQR_LOGO_MAXThe logo box as a part of the code width. Default and maximum 0.22.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QrCodeLogo

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QrCodeCaption

<figcaption>
PropTypeDefaultDescription
copyboolean—The Copy Button after the value. Default true when there are no children.
...props<figcaption> attributes—Every other attribute goes to the <figcaption>, with a ref.
  • Use it to move a link or a short text from a screen to a phone.
  • Add QrCodeCaption so people who cannot scan can read and copy the value.
  • Give a code that is not a link a label. The default name does not read other values aloud, because some hold secrets.
  • Add a logo with QrCodeLogo. The error correction then goes to H, so the code still reads.
  • For a product code that a store scanner reads, use a Barcode.

The root is a plain <figure>, not role="img", so a screen reader can still reach the caption and its button.

The SVG carries the name with aria-label: "QR code", or "QR code: <value>" for an http(s) link. Other values can hold secrets, such as a Wi-Fi password, so they are not read. Pass label to set your own name.

QrCodeCaption shows the value as text for people who cannot scan, with a Copy Button named "Copy". The button has a 44px target on touch (hit-area). The value text is dir="ltr", so a link reads left to right on a right-to-left page.

Reveal (with `animateIn`)
panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1)

Built with

Installs with QR Code

Components
Copy Button
  1. AddedQR Code, with Copy Button.
Open the release