Quick Start Install LightFastGrid and render a minimal grid in React.
What LightFastGrid is
LightFastGrid is a performance-first JavaScript data grid for large client-side
datasets. @lightfastgrid/react is the React package. It depends on
@lightfastgrid/core and loads the default theme for you.
Both packages are MIT licensed. This page shows the smallest working React
grid. Later guides will cover features such as filtering, selection, and
virtualization.
Installation
npm install @lightfastgrid/react
Working grid
Preview loads when visible.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import { LightFastGrid } from "@lightfastgrid/react" ; import { columns, getRowId, rows } from "../shared/data" ; import "../shared/styles.css" ; export function OrdersGrid () { return ( < div className = "docs-example-grid-host" > < LightFastGrid rows ={ rows } columns ={ columns } getRowId ={ getRowId } columnMenu ={{ enabled : false }} theme ={{ base : "dark" , accentColor : "#2563eb" , density : "standard" }} accessibility ={{ ariaLabel : "Orders" }} /> </ div > ); } tsx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
export const rows = [ { id: "o-1" , orderId: "1001" , customer: "Acme" , country: "DE" , total: "$1,200" }, { id: "o-2" , orderId: "1002" , customer: "Globex" , country: "US" , total: "$850" }, { id: "o-3" , orderId: "1003" , customer: "Initech" , country: "US" , total: "$640" }, { id: "o-4" , orderId: "1004" , customer: "Umbrella" , country: "JP" , total: "$2,100" }, { id: "o-5" , orderId: "1005" , customer: "Soylent" , country: "GB" , total: "$430" }, { id: "o-6" , orderId: "1006" , customer: "Hooli" , country: "US" , total: "$1,750" }, { id: "o-7" , orderId: "1007" , customer: "Stark" , country: "DE" , total: "$980" }, { id: "o-8" , orderId: "1008" , customer: "Wayne" , country: "US" , total: "$1,560" }, ]; export const columns = [ { field: "orderId" , headerName: "Order" , width: 120 }, { field: "customer" , headerName: "Customer" , width: 240 }, { field: "country" , headerName: "Country" , width: 120 }, { field: "total" , headerName: "Total" , width: 140 }, ]; export function getRowId (row) { return String (row.id); } js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
.docs-example-grid-host { box-sizing : border-box ; width : 100% ; height : 100% ; min-height : 0 ; flex : 1 1 auto ; overflow : hidden ; color : #f5f7fa ; color-scheme : dark ; background : #0b1120 ; --lfg-color-bg : #0b1120 ; --lfg-color-header-bg : #0f1524 ; --lfg-color-surface : #111827 ; --lfg-color-border : #1e293b ; --lfg-border : #1e293b ; --lfg-color-text : #f5f7fa ; --lfg-color-muted : #94a3b8 ; --lfg-color-accent : #2563eb ; --lfg-color-accent-fg : #ffffff ; --lfg-color-selected-row : #111827 ; --lfg-font-family : var( --font-sans , "IBM Plex Sans" ), system-ui, sans-serif; --lfg-font-size : 13 px; --lfg-radius-grid : 0 ; } .docs-example-grid-host .lfg-grid { border : 0 ; border-radius : 0 ; background : #0b1120 ; color : #f5f7fa ; font-family : var( --lfg-font-family ); font-size : var( --lfg-font-size ); --lfg-border : #1e293b ; --lfg-color-border : #1e293b ; } .docs-example-grid-host .lfg-viewport { background : #0b1120 ; scrollbar-width : none ; } .docs-example-grid-host . lfg-viewport ::-webkit-scrollbar { display : none ; } .docs-example-grid-host .lfg-header { background : #0f1524 ; border-bottom : 1 px solid #1e293b ; } .docs-example-grid-host .lfg-row { background : #0b1120 ; } .docs-example-grid-host . lfg-row :hover { background : #111827 ; } .docs-example-grid-host .lfg-cell { border-bottom-color : #151c2e ; } .docs-example-grid-host .lfg-header-label { color : #e2e8f0 ; font-size : 13 px; font-weight : 500 ; letter-spacing : 0 ; } .docs-example-grid-host .lfg-header-cell, .docs-example-grid-host .lfg-cell { border-right : 0 ; } .docs-example-grid-host [data-col-id= "customer" ] .lfg-cell-value { font-weight : 500 ; } .docs-example-grid-host [data-col-id= "total" ] .lfg-header-label, .docs-example-grid-host [data-col-id= "total" ] .lfg-cell-value { text-align : right; } css
1 2 3 4 5 6 7 8 9 10 11
import { createRoot } from "react-dom/client" ; import { OrdersGrid } from "./App" ; const host = document. getElementById ( "root" ); if (!host) { throw new Error ( "Missing #root" ); } createRoot (host). render (< OrdersGrid />); tsx
LightFastGrid accepts the same rows, columns, and getRowId contract as the
core Grid.
getRowId must return a unique, stable id for every row. Do not derive it from
the row's current position because sorting, filtering, and updates can move
that row.
Container sizing
The grid fills its parent. The live preview gives that host a real height.
If you omit height on LightFastGrid, the adapter uses height: 100%, so the
parent must not collapse.
Next steps
Continue with Installation and setup for
TypeScript or JavaScript configuration, client rendering, CSS ownership, and
supported environments. Then define application data with
Rows and columns .
Evaluating the React package? Start from the
React data grid overview , browse
React examples , or compare measured payloads on
Benchmarks and the
AG Grid comparison .
Next Installation and setup