Skip to main content

dataGridProps

Rows per page:

1–3 of 3

import { DataGrid } from "@mui/x-data-grid";
import { defineTable } from "@sportsdataverse/sdvtables";
import { prepare } from "@sportsdataverse/sdvtables/html";
import { dataGridProps } from "@sportsdataverse/sdvtables/mui";

const rows = [
{ team: "KC", wins: 15, pf: 385, pa: 326 },
{ team: "BUF", wins: 13, pf: 525, pa: 368 },
{ team: "LAC", wins: 11, pf: 402, pa: 301 },
];
const spec = defineTable<(typeof rows)[number]>()
.columns((c) => [c.logo("team", { league: "nfl", height: 28 }), c.int("wins"), c.int("pf"), c.int("pa")])
.theme("sdv")
.rowKey("team")
.build();
await prepare(spec);
<DataGrid rows={rows} {...dataGridProps(spec, rows, { teamRows: { key: "team", league: "nfl" } })} />;

Tags: docstring · dataGridProps. All sdvtables examples.