React hooks for generating QRCode for your next React apps.
MIT License
React hooks for generating QR code for your next React apps.
next-qrcode is available on npm. It can be installed with the following command:
npm install next-qrcode --save
next-qrcode is available on yarn as well. It can be installed with the following command:
yarn add next-qrcode --save
import React from 'react';
import { useQRCode } from 'next-qrcode';
function App() {
const { Canvas } = useQRCode();
return (
<Canvas
text={'https://github.com/bunlong/next-qrcode'}
options={{
errorCorrectionLevel: 'M',
margin: 3,
scale: 4,
width: 200,
color: {
dark: '#010599FF',
light: '#FFBF60FF',
},
}}
/>
);
}
export default App;
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;
import React from 'react';
import { useQRCode } from 'next-qrcode';
function App() {
const { Image } = useQRCode();
return (
<Image
text={'https://github.com/bunlong/next-qrcode'}
options={{
type: 'image/jpeg',
quality: 0.3,
errorCorrectionLevel: 'M',
margin: 3,
scale: 4,
width: 200,
color: {
dark: '#010599FF',
light: '#FFBF60FF',
},
}}
/>
);
}
export default App;
Latest version 2.5.1 (2023-08-01):
Details changes for each release are documented in the CHANGELOG.md.
If you think any of the next-qrcode
can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.
We'd love to have your helping hand on contributions to next-qrcode
by forking and sending a pull request!
Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)
How to contribute:
You maybe interested.
The MIT License