{"library":"react-barcode","title":"React Barcode Component","description":"react-barcode is a React component that streamlines the process of generating various barcode types within a React application. It acts as a wrapper around the robust JsBarcode library, abstracting away the direct DOM manipulation typically required for barcode rendering. The package is currently stable at version 1.6.1 and has seen active development, with recent minor releases adding support for more barcode formats like CODE128 (including GS1-128/EAN-128, CODE128A, B, and C) and minor type fixes. Its release cadence appears to be driven by feature additions and maintenance rather than strict time intervals. Key differentiators include its simple component-based API for React developers, comprehensive support for numerous barcode formats inherited from JsBarcode, and built-in TypeScript type definitions for enhanced developer experience.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-barcode"],"cli":null},"imports":["import Barcode from 'react-barcode';","const Barcode = require('react-barcode');","import type { BarcodeProps } from 'react-barcode';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React, { FunctionComponent } from 'react';\nimport Barcode from 'react-barcode';\n\ninterface MyBarcodeGeneratorProps {\n  dataValue: string;\n  barcodeFormat?: string;\n}\n\nexport const MyBarcodeGenerator: FunctionComponent<MyBarcodeGeneratorProps> = ({ dataValue, barcodeFormat = \"CODE128\" }) => {\n    return (\n        <div>\n            <h1>Generated Barcode:</h1>\n            <Barcode\n                value={dataValue}\n                format={barcodeFormat}\n                width={2}\n                height={100}\n                displayValue={true}\n                lineColor=\"#333333\"\n                background=\"#ffffff\"\n                margin={10}\n            />\n            <p>Scan this barcode!</p>\n        </div>\n    );\n};\n\n// Example usage:\n// function App() {\n//   return <MyBarcodeGenerator dataValue=\"YOUR_DATA_HERE\" barcodeFormat=\"EAN13\" />;\n// }","lang":"typescript","description":"Demonstrates how to render a barcode using the `Barcode` component with configurable value and format.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}