Super easy barcode generation for ReactJS.
This package uses JsBarcode
Note: Make sure that you have installed the correct version of
react(>= v16.8.0)
andreact-dom(>= v16.8.0)
.
npm install --save react-hooks-barcode
yarn add react-hooks-barcode
import Barcode from "react-hooks-barcode";
value
<Barcode value="https://reactjs.org/" />
const config = {
background: "#f5f5f5",
marginTop: "20px",
marginBottom: "20px",
fontOptions: "italic",
width: 2
};
<Barcode value="https://reactjs.org/" {...config} />;
{
width: 2,
height: 100,
format: "CODE128",
displayValue: true,
fontOptions: "",
font: "monospace",
textAlign: "center",
textPosition: "bottom",
textMargin: 2,
fontSize: 20,
background: "#ffffff",
lineColor: "#000000",
margin: 10,
marginTop: undefined,
marginBottom: undefined,
marginLeft: undefined,
marginRight: undefined
}
Node >= v8 LTS
npm install
npm start