# react-native-jsbarcode

> react-native barcode generator

Latest version **0.0.1** (published 2018-08-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-native-jsbarcode
pnpm add react-native-jsbarcode
yarn add react-native-jsbarcode
bun add react-native-jsbarcode
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-08-14 |
| First published | 2018-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jordan Cleigh |
| Maintainers | jcleigh |
| Keywords | react-native, barcode |

## Links

- npm: https://www.npmjs.com/package/react-native-jsbarcode
- Repository: https://github.com/jcleigh/react-native-jsbarcode
- Homepage: https://github.com/jcleigh/react-native-jsbarcode#readme
- Issues: https://github.com/jcleigh/react-native-jsbarcode/issues
- npm.io page: https://npm.io/package/react-native-jsbarcode

## Dependencies (3)

- [jsbarcode](https://npm.io/package/jsbarcode.md) ^3.9.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [create-react-class](https://npm.io/package/create-react-class.md) ^15.6.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2018-08-14

## README

# react-native-barcode
A react-native component to generate barcodes in a WebView canvas.

Utilizes [JsBarcode](https://github.com/lindell/JsBarcode) for barcode generation. Inspired by [react-native-qrcode](https://github.com/cssivision/react-native-qrcode).

## Installation
```sh
npm install react-native-barcode --save
```
## Usage
```jsx
'use strict';

import React, { Component } from 'react'
import Barcode from 'react-native-barcode';

import {
    AppRegistry,
    StyleSheet,
    View,
    TextInput
} from 'react-native';

class HelloWorld extends Component {
  state = {
    text: 'http://facebook.github.io/react-native/',
  };

  render() {
    return (
      <View style={styles.container}>
        <TextInput
          style={styles.input}
          onChangeText={(text) => this.setState({text: text})}
          value={this.state.text}
        />
        <QRCode
          value={this.state.text}
          size={200}
          bgColor='purple'
          fgColor='white'/>
      </View>
    );
  };
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: 'white',
        alignItems: 'center',
        justifyContent: 'center'
    },

    input: {
        height: 40,
        borderColor: 'gray',
        borderWidth: 1,
        margin: 10,
        borderRadius: 5,
        padding: 5,
    }
});

AppRegistry.registerComponent('HelloWorld', () => HelloWorld);

module.exports = HelloWorld;
```
## Available Props

prop      | type                 | default value
----------|----------------------|--------------
`value`   | `string`             | `http://facebook.github.io/react-native/`
`size`    | `number`             | `128`
`bgColor` | `string` (CSS color) | `"#000"`
`fgColor` | `string` (CSS color) | `"#FFF"`


# Licenses

All source code is licensed under the [MIT License](https://github.com/jcleigh/react-native-barcode/blob/master/LICENSE).

---
_Source: https://npm.io/package/react-native-jsbarcode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
