Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 1.04 KB

README.md

File metadata and controls

61 lines (50 loc) · 1.04 KB

qwik-excel-renderer

A Qwik library to render and display excel sheets on webpage.

Installation

npm i qwik-excel-renderer
pnpm add qwik-excel-renderer
yarn add qwik-excel-renderer
bun add qwik-excel-renderer
import {
  type NoSerialize,
  component$,
  noSerialize,
  useSignal,
} from "@builder.io/qwik";
import { useXLSXRenderer,XLSXTable } from "qwik-excel-renderer";

export default component$(() => {
  const { xlsxRenderer, data } = useXLSXRenderer();
  const file = useSignal<NoSerialize<File>>();
  return (
      <div>
        <input
          type="file"
          onChange$={(e) => {
            file.value = noSerialize((e.target as HTMLInputElement).files?.[0]);
          }}
        />
        <button
          onClick$={async () => {
            await xlsxRenderer(file.value);
          }}
        >
          Render XLSX data
        </button>

        {data && (
          <div>
            <XLSXTable data={data} />
          </div>
        )}
      </div>
  );
});