2.1.3 • Published 6 years ago

the-qr v2.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

the-qr

Build Status npm Version JS Standard

QRCode the-component

Installation

$ npm install the-qr --save

Usage

Live Demo is hosted on GitHub Page

'use strict'

import React from 'react'
import { TheQr, TheQrStyle } from 'the-qr'
import { TheSpinStyle } from 'the-spin'

class ExampleComponent extends React.PureComponent {
  render () {
    return (
      <div>
        <TheSpinStyle/>
        <TheQrStyle/>
        <TheQr text={null}></TheQr>

        <TheQr text={'Some URL'}
               onError={ (err) => console.error('Failed with error:', err)}
               onGenerate={ (url) => console.log('Image generated:', url)}
        ></TheQr>

        <br/>

        <TheQr text={'Some URL as Link'}
               onError={ (err) => console.error('Failed with error:', err)}
               onGenerate={ (url) => console.log('Image generated:', url)}
               asLink
        ></TheQr>

        <TheQr text={'With display size'}
               displaySize={24}
               onError={ (err) => console.error('Failed with error:', err)}
               onGenerate={ (url) => console.log('Image generated:', url)}
               asLink
        ></TheQr>
      </div>

    )
  }
}

export default ExampleComponent

Components

TheQr

QRCode the-component

Props

NameTypeDescriptionDefault
altstringAlt text'NO TEXT FOUND'
asLinkboolRender as Linkfalse
onErrorfuncHandle error(err) => console.error(err)
onGeneratefuncHandle image generate() => {}
sizenumberQRCode size256
textstringText to render as QR''
displaySizenull

TheQrStyle

Style for TheQr

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago