Autofill

Automatically fill a series of data in the Spreadsheet

Spreadsheet 2 does a series autofill based on the value of selected cells. This can be customized, if you need autofill to be powered by AI or an async API

import { SpreadsheetProvider, CanvasGrid } from "@rowsncolumns/spreadsheet";
import { useSpreadsheetState } from "@rowsncolumns/spreadsheet-state";

const MySpreadsheet = () => {
  const {  } = useSpreadsheetState({
    getAutoFillValues: async ({
      sheetId,
      direction,
      selection,
      fillBounds,
      getCellData,
      locale
    }) => {
      // return an array of cellData
    }
  })

  
  return (
    <CanvasGrid />
  );
};

const App = () => (
  <SpreadsheetProvider>
    <MySpreadsheet />
  </SpreadsheetProvider>
);

Last updated