Fancy QRCode
This repo is derive from ciaochaos/qrbtf. It extended more styles, and change the API of Options.
Preview
Below all QRCodes generate by Fancy QRCode
.
Features
- 🖼️ SVG Based QRCode Generator
- ✨ Zero Dependencies
- 🃏 Built-in render poker card symbol in QRCode eyeball
- ☕ Built-in render emoji symbol in QRCode eyeball
- 🎨 Custom Render QRCode Style Friendly
- 🤹 Custom Render QRCode
Eyeframe
& Eyeball
style - 🔵 Custom Render your icon in the center of QRCode
Install
pnpm install fancy-qrcode -S
or
yarn add fancy-qrcode -S
Usage
Render Base
renderBase
function also called createQRCode
import { renderBase } from 'fancy-qrcode'
const QRCode = renderBase()
const QRCode = createQRCode()
Typed
interface BaseRendererOptions {
eyeframeType?: EyeframeType | string;
eyeballType?: EyeballType | string;
eyeColor?: string;
type: BodyType$3 | string;
bodyColor?: string;
emojiSymbol?: string;
}
declare const createQRCode: (props?: DeepPartial<RendererOptions<BaseQROptions>> | undefined) => string;
Render Circle
import { renderCircle } from 'fancy-qrcode'
const QRCode = renderCircle()
Render DSJ
import { renderDsj } from 'fancy-qrcode'
const QRCode = renderDsj()
Render Func
import { renderFunc } from 'fancy-qrcode'
const QRCode = renderFunc()
Render ImageFill
import { renderImageFill } from 'fancy-qrcode'
const QRCode = renderImageFill()
Render Image
import { renderImage } from 'fancy-qrcode'
const QRCode = renderImage()
RenderrLine
import { renderLine } from 'fancy-qrcode'
const QRCode = renderLine()
RenderrRandRect
import { renderRandRect } from 'fancy-qrcode'
const QRCode = renderRandRect()
RenderrResImage
import { renderResImage } from 'fancy-qrcode'
const QRCode = renderResImage()
RenderrSolid
import { renderSolid } from 'fancy-qrcode'
const QRCode = renderSolid()
License
MIT @xiaoluoboding