@krishnakodoth/excel-export
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Install

npm i @krishnakodoth/excel-export

Usage

import { ExcelExport } from "@krishnakodoth/excel-export";

const App = () => {
  const data=[
    {
      name: "Worksheet-1",
      border: false,
      data: {
        columns: [
          { header: "First Name", key: "firstName" },
          { header: "Last Name", key: "lastName" },
          { header: "Purchase Price", key: "purchasePrice" },
          { header: "Payments Made", key: "paymentsMade" },
        ],
        rows: [
          {
            firstName: "Kylie",
            lastName: "James",
            purchasePrice: 1000,
            paymentsMade: 900,
          },
          {
            firstName: "Harry",
            lastName: "Peake",
            purchasePrice: 1000,
            paymentsMade: 1000,
          },
        ],
      },
    },
    {
      name: "Worksheet-2",
      border: true,
      data: {
        columns: [
          { header: "First Name", key: "firstName" },
          { header: "Last Name", key: "lastName" },
          { header: "Purchase Price", key: "purchasePrice" },
          { header: "Payments Made", key: "paymentsMade" },
        ],
        rows: [
          {
            firstName: "Kylie",
            lastName: "James",
            purchasePrice: 1000,
            paymentsMade: 900,
          },
          {
            firstName: "Harry",
            lastName: "Peake",
            purchasePrice: 1000,
            paymentsMade: 1000,
          },
        ],
      },
    },
  ];
  return (
    <div>
      <ExportExcel
        excelData={data}
        buttonName={'button name'}
        className={'btn btn-primary'}
        fileName={'print_excel_file_name'}
      />
    </div>
  );
}

Package Sidebar

Install

npm i @krishnakodoth/excel-export

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

67.2 kB

Total Files

14

Last publish

Collaborators

  • krishnakodoth