Skip to main content
Version: Next

QrCodeModal

The QR code modal acts as the user's unique identifier. Scanning the QR code will redirect to the user's profile on the Pelcro platform.

Loading...

Usage#

import React from "react";
import {
QrCodeModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const QrCodeExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("qrcode")}>
Click to view QR code
</button>
<PelcroModalController>
<QrCodeModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.