Socket
Socket
Sign inDemoInstall

react-qrcode

Package Overview
Dependencies
33
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-qrcode

🤳 A React component for QR code generation with `qrcode`


Version published
Maintainers
2
Install size
16.0 kB
Created

Readme

Source

ReactQRCode

🤳 A React component for QR code generation with qrcode

Demo

Usage

// Component
import ReactDOM from 'react-dom'
import { QRCode } from 'react-qrcode'

ReactDOM.render(<QRCode value="https://www.1stg.me" />)

// hooks
import { useQRCode } from 'react-qrcode'

export const App = () => {
  const [value, setValue] = useState('https://www.1stg.me')
  const dataUrl = useQRCode(value)
  return (
    <>
      <div>dataUrl: {dataUrl}</div>
      <img src={dataUrl} />
      <input onChange={e => setValue(e.currentTarget.value)} />
    </>
  )
}

Available Props

| prop | type (range) | default value | | ---------------------- | ------------------------------------------------------------------ | ------------------------------------------- | --- | | version | number (1-40) | N/A | | errorCorrectionLevel | String ('low', 'medium', 'quartile', 'high', 'L', 'M', 'Q', 'H') | 'M' | | maskPattern | number (0-7) | N/A | | toSJISFunc | Function | N/A | | margin | number | 4 | | scale | number | 4 | | width | number | N/A | | color | { dark: string; light:string } | { dark: '#000000ff', light: '#ffffffff' } | | type | string ('image/png', 'image/jpeg', 'image/webp') | 'image/png' | | quality | number(0-1) | 0.92 | | value | string | Array<{ data: string; mode?: string }> | N/A |

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

MIT © JounQin@1stG.me

Keywords

FAQs

Last updated on 28 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc