{"id":15416739,"url":"https://github.com/bunlong/react-xls","last_synced_at":"2025-04-19T14:33:36.790Z","repository":{"id":44729587,"uuid":"395735395","full_name":"Bunlong/react-xls","owner":"Bunlong","description":"react-xls is the fastest in-browser excel ( .xls \u0026 .xlsx ) parser for React. It is full of useful features such as useExcelDownloader, ... etc.","archived":false,"fork":false,"pushed_at":"2023-01-27T08:30:31.000Z","size":247,"stargazers_count":23,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T08:43:31.745Z","etag":null,"topics":["excel","react","react-excel-downloader","reactjs","spreadsheet","xls","xlsb","xlsm","xlsx"],"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":null}},"created_at":"2021-08-13T17:19:33.000Z","updated_at":"2024-09-14T17:49:02.000Z","dependencies_parsed_at":"2023-02-15T07:00:52.287Z","dependency_job_id":null,"html_url":"https://github.com/Bunlong/react-xls","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-xls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-xls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-xls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-xls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bunlong","download_url":"https://codeload.github.com/Bunlong/react-xls/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249715335,"owners_count":21315019,"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","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":["excel","react","react-excel-downloader","reactjs","spreadsheet","xls","xlsb","xlsm","xlsx"],"created_at":"2024-10-01T17:13:40.170Z","updated_at":"2025-04-19T14:33:36.771Z","avatar_url":"https://github.com/Bunlong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-xls\n\nreact-xls is the fastest in-browser excel ( .xls \u0026 .xlsx ) parser for React.\n\n[![NPM](https://img.shields.io/npm/v/react-xls.svg)](https://www.npmjs.com/package/react-xls) ![npm bundle size](https://img.shields.io/bundlephobia/min/react-xls) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## 🎁 Features\n\n* Compatible with both JavaScript and TypeScript\n\n## 📚 Useful Features\n\n* [useExcelDownloader](https://github.com/bunlong/react-xls#-useexceldownloader) – React hook that render the link/button which is clicked to download the data provided in excel file.\n\n## 🔧 Install\n\nreact-xls is available on npm. It can be installed with the following command:\n\n```\nnpm install react-xls --save\n```\n\nreact-xls is available on yarn as well. It can be installed with the following command:\n\n```\nyarn add react-xls --save\n```\n\n## 💡 Usage\n\n### 🎀 useExcelDownloader\n\n#### 👨‍💻 Button\n\n```js\nimport React from 'react';\n\nimport { useExcelDownloder } from 'react-xls';\n\nfunction App() {\n  const { ExcelDownloder, Type } = useExcelDownloder();\n\n  // We will make a Workbook contains 2 Worksheets\n  const data = {\n    // Worksheet named animals\n    animals: [\n      { name: 'cat', category: 'animal' },\n      { name: 'dog', category: 'animal' },\n      { name: 'pig', category: 'animal' },\n    ],\n    // Worksheet named pokemons\n    pokemons: [\n      { name: 'pikachu', category: 'pokemon' },\n      { name: 'Arbok', category: 'pokemon' },\n      { name: 'Eevee', category: 'pokemon' },\n    ],\n  };\n\n  return (\n    \u003cdiv\u003e\n      \u003cExcelDownloder\n        data={data}\n        filename={'book'}\n        type={Type.Button} // or type={'button'}\n      \u003e\n        Download\n      \u003c/ExcelDownloder\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\n#### 👨‍💻 Link\n\n```js\nimport React from 'react';\n\nimport { useExcelDownloder } from 'react-xls';\n\nfunction App() {\n  const { ExcelDownloder, Type } = useExcelDownloder();\n\n  // We will make a Workbook contains 2 Worksheets\n  const data = {\n    // Worksheet named animals\n    animals: [\n      { name: 'cat', category: 'animal' },\n      { name: 'dog', category: 'animal' },\n      { name: 'pig', category: 'animal' },\n    ],\n    // Worksheet named pokemons\n    pokemons: [\n      { name: 'pikachu', category: 'pokemon' },\n      { name: 'Arbok', category: 'pokemon' },\n      { name: 'Eevee', category: 'pokemon' },\n    ],\n  };\n\n  return (\n    \u003cdiv\u003e\n      \u003cExcelDownloder\n        data={data}\n        filename={'book'}\n        type={Type.Link} // or type={'link'}\n      \u003e\n        Download\n      \u003c/ExcelDownloder\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\n#### 📖 useExcelDownloder Returned Object\n\n| Object Properties | Description |\n| :--- | :--- |\n| ExcelDownloder | React component that render the link/button which is clicked to download the data provided in excel file. |\n| Type | Constant object ( `Type.Line` \u0026\u0026 `Type.Button` ). |\n| setData | Method that use to set data. |\n| setFilename | Method that use to set filename. |\n| setStyle | Method that use to set style. |\n| setClassName | Method that use to set className. |\n\n#### 📖 ExcelDownloder props\n\n| Props | Type | Default | Description | Required |\n| :--- | :--- | :--- | :--- | :--- |\n| children | node |  | React component, HTML element or string. | ✅ |\n| data | object |  | Downloaded data. | ✅ |\n| filename | string |  | Filename ( `.xlsx` extension is automatically added ). | ✅ |\n| type | string | 'link' |  If 'button', render button. | ❌ |\n| style | object | {} | Inline style. | ❌ |\n| className | string | '' | className | ❌ |\n\n## 📜 Changelog\n\nLatest version 0.1.0 (2021-08-15):\n\n  * Add useExcelDownloader\n\nDetails changes for each release are documented in the [CHANGELOG.md](https://github.com/Bunlong/react-xls/blob/master/CHANGELOG.md).\n\n## ❗ Issues\n\nIf you think any of the `react-xls` 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 `react-xls` 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  \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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Freact-xls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunlong%2Freact-xls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Freact-xls/lists"}