0.2.5 • Published 3 years ago
jsbarcode-react v0.2.5
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-reactusing yarn
yarn add jsbarcode-reactUsage
- 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'.