jsbarcode-react
v0.2.5
Published
JSBarcode component for React
Downloads
22
Maintainers
Readme
About
This is a React component wrapping up jsbarcode. Written as a React functional component using React hooks.
This is a component fork of react-jsbarcode
Installation
using NPM
npm i jsbarcode-react
using yarn
yarn add jsbarcode-react
Usage
- Basic usage
import Barcode from 'jsbarcode-react';
const App = () => {
return <Barcode value="ABC123" />;
};
- Advanced usage
import Barcode from 'jsbarcode-react';
const App = () => {
return <Barcode value="ABC123" options={{ format: 'code128' }} renderer="svg" />;
};
For all options refer jsbarcode wiki.
Renderers
JSBarcode supports rendering to SVG, image and canvas. Default renderer is 'svg'.