Coder Social home page Coder Social logo

devinceble / react-native-barcode-mask Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shahnawaz/react-native-barcode-mask

0.0 1.0 0.0 20 KB

A barcode and QR scan layout for react-native applications with customizable styling

License: MIT License

JavaScript 100.00%

react-native-barcode-mask's Introduction

react-native-barcode-mask

version dependencies licence

๐Ÿ“ท A barcode and QR code scan layout for react-native applications with customizable styling

Install

npm i react-native-barcode-mask -s

Usage

All you need is to import BarcodeMask from the react-native-barcode-mask module and then use it.

Example use with RNCamera

Inside <RNCamera>...</RNCamera> tag as a child component.

'use strict';
import React, { Component } from 'react';
import { RNCamera } from 'react-native-camera';
import BarcodeMask from 'react-native-barcode-mask';

...
    <RNCamera
        ...
    >
        <BarcodeMask />
    </RNCamera>
...

Examples

Few style modifications:

// Barcode
<BarcodeMask width={300} height={100} />

// QR
<BarcodeMask edgeColor={'#62B1F6'} showAnimatedLine={false}/>

// Barcode example 2
<BarcodeMask width={100} height={300} showAnimatedLine={false} transparency={0.8}/>

// Barcode example 3
<BarcodeMask width={300} height={100} edgeBorderWidth={1} />

โญ Pretty cool! Right?

Properties

width

Value: number | string (%)
Default: 280

Finder's width (the visible area)

height

Value: number | string (%)
Default: 230

Finder's height (the visible area)

edgeWidth

Value: number | string (%)
Default: 20

Edge/Corner's width

edgeHeight

Value: number | string (%)
Default: 20

Edge/Corner's height

edgeColor

Value: string
Default: #FFF

Use this to give custom color to edges

edgeBorderWidth

Value: number | string (%)
Default: 4

Use this to modify the border (thickness) of edges

backgroundColor

Value: string rgba(0, 0, 0, 0.6)
Default: rgba(0, 0, 0, 0.6)

Use this to modify the background color of area around finder

showAnimatedLine

Value: boolean true | false
Default: true

animatedLineColor

Value: string
Default: #FFF

animatedLineHeight

Value: number
Default: 2

lineAnimationDuration

Value: number
Default: 1500

Contribution

Want to add some new styles or layout?
Want to update few things?

Feel free to open a PR.

License

MIT

react-native-barcode-mask's People

Contributors

shahnawaz avatar uehqzxi avatar slavikdenis avatar devinceble avatar h11g avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.