This is a React component wrapping up jsbarcode. Written as a React functional component using React hooks.
using NPM
npm i react-jsbarcode
using yarn
yarn add react-jsbarcode
using PNPM
pnpm add react-jsbarcode
- 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.
JSBarcode supports rendering to SVG, image and canvas. Default renderer is 'svg'.