useSpreadsheet
useSpreadsheet exposes some of the internal API via hooks
import { SpreadsheetProvider, CanvasGrid, useSpreadsheet } from "@rowsncolumns/spreadsheet";
const MySpreadsheet = () => {
const {
makeEditable,
canEditCell,
cancelEditor,
focusSheet,
getCellBounds,
getCellDimensions,
getContentfulGridRangeAroundCell,
getNamedRanges,
getNextFocusableCell,
getRowHeight,
getSelectionsFromFormula,
getTableColumnNames,
getTableNames,
onEditorKeyDown,
scrollToCell,
setEditorValue,
submitEditor,
updateSelectionStartEndReference,
tokenizer,
} = useSpreadsheet();
return (
<CanvasGrid />
);
};
const App = () => (
<SpreadsheetProvider>
<MySpreadsheet />
</SpreadsheetProvider>
);API
Description
Examples
Flash cells
Show cell popover
Redraw grid
Last updated