Official Highcharts Grid Lite for React
Highcharts Grid Lite for React makes integrating interactive data tables into your React projects intuitive and aligned with your React workflow, built with an API refined for React patterns.
- Options or JSX - Pass a Grid
optionsobject, compose with React components such asData,Column,Caption, andPagination, or mix both - Self-Contained Package - Grid setup, cleanup, and CSS are handled for you
- Built for Large Tables - Row virtualization keeps scrolling smooth with thousands of records
- Interactive by Default - Sorting, filtering, and pagination without extra libraries
- Accessibility First - Renders a semantic HTML table with keyboard navigation and screen reader support
- CSS Theming - Customize appearance with CSS variables and class names that fit your app
- TypeScript Ready - First-class types for options, refs, and component props
Highcharts Grid Lite is free to use. Review the license terms at the links below:
Need editing, validation, sparklines, or events? See @highcharts/grid-pro-react.
Install Highcharts Grid Lite React from npm:
npm install @highcharts/grid-lite-reactOr using yarn:
yarn add @highcharts/grid-lite-reactNote:
@highcharts/grid-liteis included as a dependency.reactandreact-domare peer dependencies and are installed automatically with npm v7+. Requires React 18 or higher.
Components are optional. You can pass a Grid options object to <Grid> the same way as before, use JSX components, or mix both.
import { useState } from 'react';
import { Grid, type GridOptions } from '@highcharts/grid-lite-react';
export function App() {
const [options] = useState<GridOptions>({
caption: { text: 'Team directory' },
data: {
columns: {
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45],
city: ['New York', 'Oslo', 'Paris']
}
}
});
return <Grid options={options} />;
}import { Grid, Caption, Data, Column, Header, Pagination } from '@highcharts/grid-lite-react';
export function App() {
return (
<Grid>
<Caption>Team directory</Caption>
<Data
columns={{
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45],
city: ['New York', 'Oslo', 'Paris']
}}
/>
<Header options={['name', 'age', 'city']} />
<Column id="name" headerFormat="Name" sortingEnabled />
<Column id="age" dataType="number" headerFormat="Age" />
<Column id="city" headerFormat="City" />
<Pagination pageSize={5} />
</Grid>
);
}Each option component also accepts an options prop with the same JSON as the Grid JS API. Flattened props override that object.
The grid is rendered inside a container. You can pass layout and theme props directly to Grid:
<Grid
className="grid-shell"
tableClassName="w-full"
theme="hcg-theme-default"
>
<Caption>Full-width grid</Caption>
<Data columns={{ name: ['Alice', 'Bob'], age: [23, 34] }} />
</Grid>classNameapplies to the React mount containertableClassNameapplies to the rendered tablethemesets the Grid theme (rendering.theme)
Use GridOptions for the Grid component options prop.
import { useState } from 'react';
import { Grid, type GridOptions } from '@highcharts/grid-lite-react';
export function App() {
const [options] = useState<GridOptions>({
data: {
columns: {
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45]
}
}
});
return <Grid options={options} />;
}Use GridRefHandle and GridInstance when you need access to the underlying Grid instance.
import { useRef } from 'react';
import {
Grid,
type GridOptions,
type GridRefHandle,
type GridInstance
} from '@highcharts/grid-lite-react';
export function App() {
const gridRef = useRef<GridRefHandle<GridOptions> | null>(null);
const onGridReady = (grid: GridInstance<GridOptions>) => {
console.log('Grid instance:', grid);
};
return (
<Grid
gridRef={gridRef}
callback={onGridReady}
options={{
data: {
columns: {
name: ['Alice', 'Bob'],
age: [23, 34]
}
}
}}
/>
);
}Grid uses browser APIs, so it must render on the client. Use a dynamic import with SSR disabled:
'use client';
import { useState } from 'react';
import dynamic from 'next/dynamic';
import { type GridOptions } from '@highcharts/grid-lite-react';
const Grid = dynamic(
() => import('@highcharts/grid-lite-react').then((mod) => mod.Grid),
{ ssr: false }
);
export default function Page() {
const [options] = useState<GridOptions>({
data: {
columns: {
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45]
}
}
});
return <Grid options={options} />;
}The React package loads Grid CSS automatically. See the Next.js guide for more detail.
For comprehensive guides and API documentation, visit the Highcharts Grid React documentation.
We love to learn how you are using Highcharts, and what you would like to see from us in the future.
Join our vibrant community on GitHub, Stack Overflow, Discord, and the Highcharts Forums.
Commercial support packages are available, see Highcharts Advantage.