1.0.0 • Published 4 months ago

@synthifydev/qrcode v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@alqr/qrcode

Enhanced QR Code generator for React with SVG support, forked from awesome-qrcode.

Features

  • ✨ SVG Download Support
  • ✅ Easily customizable
  • 🦄 Built on top of qrcode-generator
  • 🎨 Custom styling options

Installation

npm install @alqr/qrcode
# or
yarn add @alqr/qrcode
# or
pnpm add @alqr/qrcode

Usage

import { AwesomeQRCode } from "@alqr/qrcode";

function App() {
  const qrRef = useRef();

  const downloadSVG = () => {
    if (qrRef.current) {
      const svgUrl = qrRef.current.getSvgUrl();
      const link = document.createElement('a');
      link.href = svgUrl;
      link.download = 'qr-code.svg';
      link.click();
    }
  };

  return (
    <>
      <AwesomeQRCode
        ref={qrRef}
        value="https://example.com"
        size={200}
        dataStyle="dots"
      />
      <button onClick={downloadSVG}>Download SVG</button>
    </>
  );
}

License

MIT

1.0.0

4 months ago