Skip to main content

QRCode
component

Requires use within a POSReceiptBlock component

A component that renders a QR code in Shopify POS.

Note

This is part of a POS UI Extensions developer preview. More information to come.

string
required

The content to be encoded in the QR code.

Was this section helpful?

Render a QRCode in POS receipts

import React from 'react';
import {
POSReceiptBlock,
QRCode,
reactExtension,
useApi,
} from '@shopify/ui-extensions-react/point-of-sale';

const ReceiptFooterWithQRCodeBlock = () => {
const api = useApi(
'pos.receipt-footer.block.render',
);

return (
<POSReceiptBlock>
<QRCode
value={`https://shopify.com?example=${encodeURIComponent(
api.transaction.orderId ?? '',
)}`}
/>
</POSReceiptBlock>
);
};

export default reactExtension(
'pos.receipt-footer.block.render',
() => <ReceiptFooterWithQRCodeBlock />,
);