🤳 A React component for QR code generation with qrious
npm install react-qrious🤳 A React component for QR code generation with qrious
``tsx
// Component
import ReactDOM from 'react-dom'
import { QRious } from 'react-qrious'
ReactDOM.render(
document.getElementById('qrious'),
)
// hooks
import { useQrious } from 'react-qrious'
export const App = () => {
const [value, setValue] = useState('https://www.1stg.me')
const [dataUrl, _qrious] = useQrious({ value })
return (
<>
Available Props
| prop | type | default value |
| ----------------- | ------------------------------------ | ------------- |
|
background | string (CSS color) | "#ffffff" |
| backgroundAlpha | number (0.1-1.0) | 1.0 |
| foreground | string (CSS color) | "#000000" |
| foregroundAlpha | number (0.1-1.0) | 1.0 |
| level | string ("L", "M", "Q", "H") | "L" |
| mime | string ("image/png", "image/jpeg") | "image/png" |
| padding | number | null |
| size | number | 100 |
| value | string` | || 1stG | RxTS | UnTS |
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|  |  |  |
| 1stG | RxTS | UnTS |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|  |  |  |
Detailed changes for each release are documented in CHANGELOG.md.
[MIT][] © [JounQin][]@[1stG.me][]
[1stg.me]: https://www.1stg.me
[jounqin]: https://GitHub.com/JounQin
[mit]: http://opensource.org/licenses/MIT