--- title: QRCode description: Used to quickly access scannable data. api_version: 2025-07 api_name: checkout-ui-extensions source_url: html: >- https://shopify.dev/docs/api/checkout-ui-extensions/2025-07/components/other/qrcode md: >- https://shopify.dev/docs/api/checkout-ui-extensions/2025-07/components/other/qrcode.md --- # QRCode Used to quickly access scannable data. ## QRCodeProps * accessibilityLabel string Default: 'QR code' (translated to the user’s locale) A label that describes the purpose or contents of the QR code. When set, it will be announced to users using assistive technologies and will provide more context about what the QR code may do when scanned. * border Extract\ Default: 'base' Adjust the border style. * content string The content to be encoded in the QR code, which can be any string such as a URL, email address, plain text, etc. Specific string formatting can trigger actions on the user’s device when scanned, like opening geolocation coordinates on a map, opening a preferred app or app store entry, preparing an email, text message, and more. * id string A unique identifier for the component. * logo string URL of an image to be displayed in the center of the QR code. This is useful for branding or to indicate to the user what scanning the QR code will do. By default, no image is displayed. * onError () => void Invoked when the conversion of `content` to a QR code fails. If an error occurs, the QR code and its child elements will not be displayed. * size 'auto' | 'fill' Default: 'auto' The displayed size of the QR code. `fill`: the QR code will takes up 100% of the available inline-size and maintain a 1:1 aspect ratio. `auto`: the QR code will be displayed at its default size. ### BorderStyle ```ts 'base' | 'dashed' | 'dotted' | 'none' ``` ### Examples * #### Basic QR Code ##### React ```tsx import { reactExtension, Link, QRCode, TextBlock, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => , ); function Extension() { return ( <> Scan to visit{' '} Shopify.com ); } ``` ##### JS ```js import { extension, Link, QRCode, TextBlock, } from '@shopify/ui-extensions/checkout'; export default extension('purchase.checkout.block.render', (root) => { const qrCode = root.createComponent(QRCode, { content: 'https://shopify.com', }); const textBlock = root.createComponent(TextBlock, null, [ 'Scan to visit ', root.createComponent(Link, {to: 'https://shopify.com'}, 'Shopify.com'), ]); root.appendChild(qrCode); root.appendChild(textBlock); }); ``` ## Preview ![](https://shopify.dev/images/templated-apis-screenshots/checkout-ui-extensions/2025-07/qrcode-default.png) ## Best Practices * Always test that the QR code is scannable from a smartphone. * Include a square logo if that’s what your customers are familiar with. * Increase usability by adding a text description of what the QR code does. * Always provide an alternate method for customers to access the content of the QR code. * If the content is a URL, provide a [`Link`](https://shopify.dev/docs/api/checkout-ui-extensions/components/link) nearby. * If the content is data, provide a [`Button`](https://shopify.dev/docs/api/checkout-ui-extensions/components/button) to copy the data to the clipboard, or show the data in a readonly [`TextField`](https://shopify.dev/docs/api/checkout-ui-extensions/components/textfield). ## Examples With logo The QRCode component can display an image in the center. Adding a logo can increase brand trust and set expectations for the action when scanning. Fill size In most cases the default size should work well. If you need a different size, use `fill` to make it grow to the size of its parent container. Copying content of a QR code to the user's clipboard When displaying a QR code, include an alternative way for the user to get the content ### Examples * #### With logo ##### Description The QRCode component can display an image in the center. Adding a logo can increase brand trust and set expectations for the action when scanning. ##### React ```jsx import { reactExtension, Link, QRCode, TextBlock, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => , ); function Extension() { return ( <> Scan to visit{' '} Shopify.com ); } ``` ##### JavaScript ```js import { extension, QRCode, TextBlock, Link, } from '@shopify/ui-extensions/checkout'; export default extension( 'purchase.checkout.block.render', (root) => { const qrCode = root.createComponent(QRCode, { content: 'https://shopify.com', logo: 'https://cdn.shopify.com/YOUR_IMAGE_HERE', }); const textBlock = root.createComponent( TextBlock, null, [ 'Scan to visit ', root.createComponent( Link, {to: 'https://shopify.com'}, 'Shopify.com', ), ], ); root.appendChild(qrCode); root.appendChild(textBlock); }, ); ``` * #### Fill size ##### Description In most cases the default size should work well. If you need a different size, use \`fill\` to make it grow to the size of its parent container. ##### React ```jsx import { reactExtension, QRCode, View, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => , ); function Extension() { return ( ); } ``` ##### JavaScript ```js import { extension, View, QRCode, } from '@shopify/ui-extensions/checkout'; export default extension( 'purchase.checkout.block.render', (root) => { const view = root.createComponent(View, { maxInlineSize: 300, }); const qrCode = root.createComponent(QRCode, { content: 'https://shopify.com', size: 'fill', }); view.appendChild(qrCode); root.appendChild(view); }, ); ``` * #### Copying content of a QR code to the user's clipboard ##### Description When displaying a QR code, include an alternative way for the user to get the content ##### React ```jsx import { reactExtension, BlockStack, Button, ClipboardItem, QRCode, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => , ); function Extension() { const bitcoinAddress = '14qViLJfdGaP4EeHnDyJbEGQysnCpwk3gd'; return ( ); } ``` ##### JavaScript ```js import { extension, BlockStack, Button, ClipboardItem, QRCode, } from '@shopify/ui-extensions/checkout'; export default extension( 'purchase.checkout.block.render', (root) => { const bitcoinAddress = '14qViLJfdGaP4EeHnDyJbEGQysnCpwk3gd'; const qrCodeContent = `bitcoin:${bitcoinAddress}`; const qrCode = root.createComponent(QRCode, { content: qrCodeContent, size: 'fill', }); const clipboardItem = root.createComponent( ClipboardItem, { text: bitcoinAddress, id: 'bitcoin-address', }, ); const button = root.createComponent( Button, { activateTarget: 'bitcoin-address', }, 'Copy Bitcoin address', ); const blockStack = root.createComponent( BlockStack, { maxInlineSize: 200, }, ); blockStack.appendChild(qrCode); blockStack.appendChild(button); blockStack.appendChild(clipboardItem); root.appendChild(blockStack); }, ); ``` ## Preview ![](https://shopify.dev/images/templated-apis-screenshots/checkout-ui-extensions/2025-07/qrcode-image.png) ## Related [![](https://shopify.dev/images/icons/32/pickaxe-1.png)![](https://shopify.dev/images/icons/32/pickaxe-1-dark.png)](https://shopify.dev/docs/api/checkout-ui-extensions/2025-07/components/other/clipboarditem) [ComponentClipboardItem](https://shopify.dev/docs/api/checkout-ui-extensions/2025-07/components/other/clipboarditem)