Conditional formatting
Change text or background colour of cells based on the value
import { SpreadsheetProvider, CanvasGrid } from "@rowsncolumns/spreadsheet";
const MySpreadsheet = () => {
return (
<CanvasGrid
conditionalFormats={[
{
ranges: [
{
startRowIndex: 1,
endRowIndex: 1000,
startColumnIndex: 2,
endColumnIndex: 2,
},
],
booleanRule: {
condition: {
type: "NUMBER_LESS",
values: [
{
userEnteredValue: "0",
},
],
},
format: {
backgroundColor: "red",
},
},
},
]}
/>
);
};
const App = () => (
<SpreadsheetProvider>
<MySpreadsheet />
</SpreadsheetProvider>
);
Gradient scale or heatmaps
Supported conditions
Adding conditional format editor UI

Last updated