1.0.1 • Published 1 year ago
react-jsbarcode v1.0.1
react-jsbarcode
About
This is a React component wrapping up jsbarcode. Written as a React functional component using React hooks.
Demo
Installation
using NPM
npm i react-jsbarcodeusing yarn
yarn add react-jsbarcodeusing PNPM
pnpm add react-jsbarcodeUsage
- Basic usage
import { ReactBarcode } from 'react-jsbarcode';
const App = () => {
return <ReactBarcode value="ABC123" />;
};- Advanced usage
import { ReactBarcode } from 'react-jsbarcode';
const App = () => {
return <ReactBarcode 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'.