useQRCode
SVG

💡 SVG

👨‍💻 Code

import React from 'react'
import { useQRCode } from 'next-qrcode'
 
function App() {
  const { SVG } = useQRCode()
 
  return (
    <SVG
      text={'https://github.com/bunlong/next-qrcode'}
      options={{
        margin: 2,
        width: 200,
        color: {
          dark: '#010599FF',
          light: '#FFBF60FF',
        },
      }}
    />
  )
}
 
export default App

📖 Props

PropTypeRequireDescription
textstring✔️Text/URL to encode.
optionsoptionsQR code options.

📚 Options

PropTypeDefaultRequireDescription
marginnumber4Define how much wide the quiet zone should be.
widthnumber4Forces a specific width for the output image. If width is too small to contain the qr symbol, this option will be ignored. Takes precedence over scale.
color.darkstring#000000ffColor of dark module. Value must be in hex format (RGBA). Note: dark color should always be darker than color.light.
color.lightstring#ffffffffColor of light module. Value must be in hex format (RGBA).