# @adactive/arc-qrcode

> Adsum QrCode Component

Latest version **2.5.3** (published 2019-05-07) · UNLISENCED license · 0 weekly downloads

## Install

```sh
npm install @adactive/arc-qrcode
pnpm add @adactive/arc-qrcode
yarn add @adactive/arc-qrcode
bun add @adactive/arc-qrcode
```

Provides the command `arc-qrCode`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.5.3 |
| Published | 2019-05-07 |
| First published | 2018-06-26 |
| Weekly downloads | 0 |
| License | UNLISENCED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stanley Ong |
| Maintainers | adactive-bot, clientadactive, moroine, naei |
| Keywords | adsum, react, redux |

## Links

- npm: https://www.npmjs.com/package/@adactive/arc-qrcode
- Repository: https://github.com/adactiveasia/adsum-react-components
- Homepage: https://github.com/adactiveasia/adsum-react-components#readme
- Issues: https://github.com/adactiveasia/adsum-react-components.git/issues
- npm.io page: https://npm.io/package/@adactive/arc-qrcode

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [qrcode.es](https://npm.io/package/qrcode.es.md) ^1.0.0
- [react-responsive-modal](https://npm.io/package/react-responsive-modal.md) ^3.0.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.5.3 (latest) — 2019-05-07
- 2.5.1 — 2019-05-03
- 2.5.0 — 2019-04-22
- 2.4.0 — 2019-04-12
- 2.3.0 — 2019-04-10
- 2.2.0 — 2018-12-12
- 2.2.0-rc.4 — 2018-12-12
- 2.2.0-rc.3 — 2018-12-12
- 2.2.0-rc.2 — 2018-12-12
- 2.2.0-rc.1 — 2018-12-12
- 2.2.0-rc.0 — 2018-12-12
- 2.2.0-alpha.1 — 2018-12-11
- 2.2.0-alpha.0 — 2018-12-11
- 2.1.0 — 2018-11-28
- 2.1.0-rc.1 — 2018-11-28
- … 53 more at https://npm.io/package/@adactive/arc-qrcode/versions

## README

# QrCode component

## Getting started

```javascript
    npm i --save @adactive/arc-qrcode
```
OR
```javascript
    yarn add @adactive/arc-qrcode
```

### Usage
```javascript
    import AdsumQrCode, { modes, ecLevel } from '@adactive/arc-qrcode';
    ...
    state = {
        openModal: false
    }
    
    onOpenModal = () => {
        this.setState({ openModal: true });
    };
    
    onCloseModal = () => {
        this.setState({ openModal: false });
    };
    
    const qrCodeOptions = {
        size: 400,
        ecLevel: ecLevel.QUARTILE,
        minVersion: 8,
        background: '#fff',
        mode: modes.DRAW_WITH_IMAGE_BOX,
        radius: 0.5,
        image: 'https://raw.githubusercontent.com/AdactiveSAS/adsum-react-components/master/logo.jpg',
        mSize: 0.15,
    };
    
    <button onClick={this.onOpenModal}>Open QrCode Modal</button>
    
    <AdsumQrCode
        isOpen={this.state.openModal}
        onClose={this.onCloseModal}
        qrCodeOptions={qrCodeOptions}
        text="https://adactive.com"
    />
```
### Props

```javascript
type PropsType = {|
    +isOpen: boolean,
    +onClose: () => null,
    +text: string,
    +qrCodeOptions: Object,
    +ModalProps?: Object,
    +qrCodeCSS?: CSSStyleDeclaration
|};

static defaultProps = {
    isOpen: false,
    onClose: () => null,
    text: '',
    qrCodeOptions: {},
    ModalProps: {},
};
```

**isOpen** -> To show or hide qrCode component

**onClose** -> A callback function to close the qrCode component

**text** -> Url value to be embedded into qrcode

**qrCodeOptions** -> Refer to [qrcode.es](https://github.com/adactiveasia/qrcode.js) for more information

**ModalProps** -> Refer to [react-responsive-modal](https://github.com/pradel/react-responsive-modal) for more information

**qrCodeCSS** ->  To customise CSS for the qrCode canvas

## Copy component inside your project src folder  

### Less only
    `npx @adactive/arc-qrCode copy --less-only`
    
### Full copy
    `npx @adactive/arc-qrCode copy`

---
_Source: https://npm.io/package/@adactive/arc-qrcode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
