Skip to main content

rowStyle

Description

Optional. Defines the style of a row in the table

Usage

rowStyle?: (row: any) => string;

Parameters

The function takes the following parameters:

  • row - an object with the row configuration, where key is the row ID:
{
[key: string]: any;
}

The function returns the name of a CSS class or an empty string.

Example

import { getData } from "./common/data";
import { Grid } from "@svar-ui/react-grid";

export default function Example() {
const { data, columns } = getData();

return (
<Grid
data={data}
columns={columns}
rowStyle={row => (row.id == 11 ? 'rowStyle' : '')}
/>
);
}
.rowStyle:not(.selected) .cell {
color: white;
background: #0ebf6c;
}