Skip to content

Ember addon to generate barcodes using the JSBarcode library

License

Notifications You must be signed in to change notification settings

NullVoxPopuli/ember-cli-barcode

 
 

Repository files navigation

Latest NPM release TravisCI Build Status License Dependencies Dev Dependencies Ember Observer Score

ember-cli-barcode

A ember-cli addon to render barcodes using the JsBarcode library. See the demo to experiment with many of the barcode options.

The addon adds accessibility attributes and elements to the generated barcodes. See the Accessibility section below.

Compatibility

  • Ember.js v2.4 or above
  • Ember CLI v2.13 or above

Installation

  $ ember install ember-cli-barcode

By default all barcode types are added to your app. See the build configuration section for slimming your build

Simple Usage

The simplest form to render a barcode is to pass in a value and the default options will generate a CODE128 barcode:

<BarCode @value="abc123456" />

which renders:

alt text

All examples use angle bracket invocation available in Ember 3.4+. The example above using classic component invocation would be:

{{bar-code value="abc123456"}}

By default, barcodes are rendered using the svg element. The element can be changed to img or canvas using the tagName property:

<BarCode
  @value="A45689"
  @tagName="img"
/>

<BarCode
  value="A45689"
  tagName="canvas"
/>

Use the img tag if you want the ability to right-click copy or save the displayed barcode.

See the Options readme for detailed barcode options.

See the Contributing guide for details.

About

Ember addon to generate barcodes using the JSBarcode library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 76.4%
  • HTML 22.7%
  • CSS 0.9%