Named ranges

Name ranges and use it in formulas

Pass namedRanges object to SheetGrid, so that it can suggest named ranges when user enters a formula

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

const MySpreadsheet = () => {
  const [namedRanges, onChangeNamedRanges] = useState<NamedRange[]>([]);
  // Removed for brevity
  const {...} = useSpreadsheetState({
    namedRanges,
  });
  return <CanvasGrid namedRanges={namedRanges} />;
};

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

Currently, there is no UI to add/edit named ranges

Last updated