qrcode.react

A component for use with React.

  • 所有者: zpao/qrcode.react
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

qrcode.react

A React component to generate QR codes.

Installation

npm install qrcode.react

Usage

var React = require('react');
var QRCode = require('qrcode.react');

React.render(
  <QRCode value="http://facebook.github.io/react/" />,
  mountNode
);

Available Props

prop, type, default value
----------, ----------------------, --------------
value, string, renderAs, string ('canvas' 'svg'), 'canvas'
size, number, 128
bgColor, string (CSS color), "#FFFFFF"
fgColor, string (CSS color), "#000000"
level, string ('L' 'M' 'Q' 'H'), 'L'
includeMargin, boolean, false
imageSettings, object (see below), ### imageSettings

field, type, default value
-----------, ----------------------, --------------
src, string, x, number, none, will center
y, number, none, will center
height, number, 10% of size
width, number, 10% of size
excavate, boolean, false

Custom Styles

qrcode.react will pass through any additional props to the underlying DOM node (<svg> or <canvas>). This allows the use of inline style or custom className to customize the rendering. One common use would be to support a responsive layout.

Note: In order to render QR Codes in <canvas> on high density displays, we scale the canvas element to contain an appropriate number of pixels and then use inline styles to scale back down. We will merge any additional styles, with custom height and width overriding our own values. This allows scaling to percentages but if scaling beyond the size, you will encounter blurry images. I recommend detecting resizes with something like react-measure to detect and pass the appropriate size when rendering to <canvas>.

LICENSE ISC

主要指標

概覽
名稱與所有者zpao/qrcode.react
主編程語言TypeScript
編程語言Makefile (語言數: 3)
平台
許可證Other
所有者活动
創建於2014-03-16 22:29:59
推送於2025-03-29 05:18:58
最后一次提交
發布數30
最新版本名稱v4.2.0 (發布於 2024-12-11 09:21:25)
第一版名稱v0.1.1 (發布於 )
用户参与
星數4.1k
關注者數24
派生數340
提交數271
已啟用問題?
問題數165
打開的問題數22
拉請求數91
打開的拉請求數8
關閉的拉請求數114
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?