{"id":15416727,"url":"https://github.com/bunlong/next-barcode","last_synced_at":"2025-09-20T07:31:09.833Z","repository":{"id":38384856,"uuid":"269373214","full_name":"Bunlong/next-barcode","owner":"Bunlong","description":"React hooks for generating Barcode for your next React apps.","archived":false,"fork":false,"pushed_at":"2023-10-25T09:07:01.000Z","size":162,"stargazers_count":63,"open_issues_count":10,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-06T03:40:00.843Z","etag":null,"topics":["barcode","barcodes","hooks","javascript","next-barcode","react","react-barcode","react-barcodes","react-hooks","reactjs","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bunlong.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"supports/create-next-app/.eslintrc.json","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-04T13:53:32.000Z","updated_at":"2024-07-16T06:22:46.000Z","dependencies_parsed_at":"2024-06-18T17:01:03.595Z","dependency_job_id":"1a1614e0-d855-45d2-bce3-9a699d92aeb7","html_url":"https://github.com/Bunlong/next-barcode","commit_stats":{"total_commits":55,"total_committers":3,"mean_commits":"18.333333333333332","dds":"0.036363636363636376","last_synced_commit":"6a98f221125043a14de7026f8c9c7c73450b084b"},"previous_names":["bunlong/react-barcodes","createnextapp/react-barcode"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Bunlong/next-barcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fnext-barcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fnext-barcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fnext-barcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fnext-barcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bunlong","download_url":"https://codeload.github.com/Bunlong/next-barcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fnext-barcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064220,"owners_count":25578997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode","barcodes","hooks","javascript","next-barcode","react","react-barcode","react-barcodes","react-hooks","reactjs","typescript"],"created_at":"2024-10-01T17:13:36.986Z","updated_at":"2025-09-20T07:31:09.545Z","avatar_url":"https://github.com/Bunlong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-barcode\n\nReact hooks for generating Barcode for your next React apps.\n\n[![downloads](https://img.shields.io/npm/dm/next-barcode.svg?label=monthly%20downloads)](https://www.npmjs.com/package/next-barcode) [![downloads](https://img.shields.io/npm/dt/next-barcode.svg?label=total%20downloads)](https://www.npmjs.com/package/next-barcode)\n\n[![NPM](https://img.shields.io/npm/v/next-barcode.svg)](https://www.npmjs.com/package/next-barcode) ![npm bundle size](https://img.shields.io/bundlephobia/min/next-barcode) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\n[Live demo](https://p30pk.csb.app)\n\n## 🎁 Features\n\n* Compatible with both JavaScript and TypeScript\n* Generate as SVG, Canvas and Image\n* Support multiple barcodes type\n\n### Barcodes Type\n\n* [CODE128](https://github.com/Bunlong/next-barcode/wiki/CODE128)\n  * CODE128 (automatic mode switching)\n  * CODE128 A/B/C (force mode)\n* [EAN](https://github.com/Bunlong/next-barcode/wiki/EAN)\n  * EAN-13\n  * EAN-8\n  * EAN-5\n  * EAN-2\n  * UPC (A)\n  * UPC (E)\n* [CODE39](https://github.com/Bunlong/next-barcode/wiki/CODE39)\n* [ITF](https://github.com/Bunlong/next-barcode/wiki/ITF-14)\n  * ITF\n  * ITF-14\n* [MSI](https://github.com/Bunlong/next-barcode/wiki/MSI)\n  * MSI10\n  * MSI11\n  * MSI1010\n  * MSI1110\n* [Pharmacode](https://github.com/Bunlong/next-barcode/wiki/pharmacode)\n* [Codabar](https://github.com/Bunlong/next-barcode/wiki/codabar)\n\n## 🔧 Install\n\nnext-barcode is available on npm. It can be installed with the following command:\n\n```\nnpm install next-barcode --save\n```\n\nnext-barcode is available on yarn as well. It can be installed with the following command:\n\n```\nyarn add next-barcode\n```\n\n## 💡 Usage\n\n### SVG\n\n```js\nimport React from 'react';\nimport { useBarcode } from 'next-barcode';\n\nfunction App() {\n  const { inputRef } = useBarcode({\n    value: 'next-barcode',\n    options: {\n      background: '#ccffff',\n    }\n  });\n  \n  return \u003csvg ref={inputRef} /\u003e;\n};\n\nexport default App;\n```\n\u003cimg src=\"https://raw.githubusercontent.com/bunlong/next-barcode/master/README/svg.png\" alt=\"next-barcode svg\" /\u003e\n\n### Canvas\n\n```js\nimport React from 'react';\nimport { useBarcode } from 'next-barcode';\n\nfunction App() {\n  const { inputRef } = useBarcode({\n    value: 'next-barcode',\n    options: {\n      displayValue: false,\n      background: '#ffc0cb',\n    }\n  });\n  \n  return \u003ccanvas ref={inputRef} /\u003e;\n};\n\nexport default App;\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/bunlong/next-barcode/master/README/canvas.png\" alt=\"next-barcode canvas\" /\u003e\n\n### Image\n\n```js\nimport React from 'react';\nimport { useBarcode } from 'next-barcode';\n\nfunction App() {\n  const { inputRef } = useBarcode({\n    value: 'next-barcode',\n    options: {\n      background: '#ffff00',\n    }\n  });\n  \n  return \u003cimg ref={inputRef} /\u003e;\n};\n\nexport default App;\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/bunlong/next-barcode/master/README/img.png\" alt=\"next-barcode image\" /\u003e\n\n## Parameters\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eProp\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eRequire\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003cthead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003evalue\u003c/td\u003e\n      \u003ctd\u003estring\u003c/td\u003e\n      \u003ctd\u003e✔️\u003c/td\u003e\n      \u003ctd\u003eText to generate.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eoptions\u003c/td\u003e\n      \u003ctd\u003eoptions\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eBarcode options.\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Options\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDefault\u003c/th\u003e\n      \u003cth\u003eRequire\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003cthead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eformat\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003eauto\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSelect which barcode type to use. Please check the \u003ca href=\"https://github.com/Bunlong/next-barcode/wiki\"\u003ewikipage\u003c/a\u003e of the different barcode types for more information.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ewidth\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e2\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eThe width option is the width of a single bar.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eheight\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e100\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eThe height of the barcode.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003edisplayValue\u003c/td\u003e\n      \u003ctd\u003eboolean?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003etext\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003eundefined\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eOveride the text that is diplayed\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003efontOptions\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"\"\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eWith fontOptions you can add bold or italic text to the barcode.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003efont\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"monospace\"\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eDefine the font used for the text in the generated barcode. This can be any default font or a font defined by a @font-face rule.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003etextAlign\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"center\"\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSet the horizontal alignment of the text. Can be \u003ccode\u003eleft\u003c/code\u003e / \u003ccode\u003ecenter\u003c/code\u003e / \u003ccode\u003eright\u003c/code\u003e.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003etextPosition\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"bottom\"\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSet the vertical position of the text. Can be \u003ccode\u003ebottom\u003c/code\u003e / \u003ccode\u003etop\u003c/code\u003e.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003etextMargin\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e2\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSet the vertical position of the text. Can be \u003ccode\u003ebottom\u003c/code\u003e / \u003ccode\u003etop\u003c/code\u003e.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003efontSize\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e20\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSet the size of the text.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ebackground\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"#ffffff\"\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSet the background of the barcode.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003elineColor\u003c/td\u003e\n      \u003ctd\u003estring?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"#000000\"\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSet the color of the bars and the text.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003emargin\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e10\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eSet the space margin around the barcode. If nothing else is set, all side will inherit the margins property but can be replaced if you want to set them separably.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003emarginTop\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003eundefined\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003emarginBottom\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003eundefined\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003emarginLeft\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003eundefined\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003emarginRight\u003c/td\u003e\n      \u003ctd\u003enumber?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003eundefined\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eflat\u003c/td\u003e\n      \u003ctd\u003eboolean?\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eOnly for \u003ccode\u003eEAN8\u003c/code\u003e / \u003ccode\u003eEAN13\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## 📜 Changelog\n\nLatest version 1.5.0 (2023-07-14):\n\n  * Upgrade dependencies\n\nDetails changes for each release are documented in the [CHANGELOG.md](https://github.com/Bunlong/next-barcode/blob/master/CHANGELOG.md).\n\n## ❗ Issues\n\nIf you think any of the `next-barcode` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.\n\n## 🌟 Contribution\n\nWe'd love to have your helping hand on contributions to `next-barcode` by forking and sending a pull request!\n\nYour contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)\n\nHow to contribute:\n\n- Open pull request with improvements\n- Discuss ideas in issues\n- Spread the word\n- Reach out with any feedback\n\n## 🏆 Contributors\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ca href=\"https://github.com/Bunlong\"\u003e\n        \u003cimg src=\"https://avatars0.githubusercontent.com/u/1308397?s=400\u0026u=945dc6b97571e2b98b659d34b1c81ae2514046bf\u0026v=4\" width=\"100\" alt=\"Bunlong\" /\u003e\n        \u003cbr /\u003e\n        \u003csub\u003e\n          \u003cb\u003eBunlong\u003c/b\u003e\n        \u003c/sub\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ca href=\"https://github.com/dennis-8\"\u003e\n        \u003cimg src=\"https://avatars.githubusercontent.com/u/4423231?v=4\" width=\"100\" alt=\"Dennis N.\" /\u003e\n        \u003cbr /\u003e\n        \u003csub\u003e\n          \u003cb\u003eDennis N.\u003c/b\u003e\n        \u003c/sub\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ca href=\"https://github.com/Handers85\"\u003e\n        \u003cimg src=\"https://avatars.githubusercontent.com/u/90617297?v=4\" width=\"100\" alt=\"Handers\" /\u003e\n        \u003cbr /\u003e\n        \u003csub\u003e\n          \u003cb\u003eHanders\u003c/b\u003e\n        \u003c/sub\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## ⚖️ License\n\nThe MIT License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003c!-- https://raw.githubusercontent.com/bunlong/next-barcode/master/README/logo.png --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Fnext-barcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunlong%2Fnext-barcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Fnext-barcode/lists"}