Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
ea622a5
Init demo.
sebastianbochan Jun 22, 2026
70e0846
Options attrib as optional.
sebastianbochan Jun 29, 2026
360a72f
Added children support in Grid.
sebastianbochan Jun 29, 2026
651d8ae
Created Caption.jsx component.
sebastianbochan Jun 30, 2026
dd9055a
Fixed overloads.
sebastianbochan Jun 30, 2026
380c878
Added description component.
sebastianbochan Jun 30, 2026
ad721bb
Added Data component.
sebastianbochan Jun 30, 2026
88fe92a
Added Data, Columns and Column components.
sebastianbochan Jul 1, 2026
0f7b4bb
Merge pull request #14 from highcharts/components/description
sebastianbochan Jul 1, 2026
3a46471
Merge grid/jsx-components into components/columns-column.
sebastianbochan Jul 1, 2026
fa3e1fa
Added ColumnDefaults compomnent.
sebastianbochan Jul 2, 2026
c4e962d
Refactored Columsn and Data options.
sebastianbochan Jul 6, 2026
18ff179
Fixed conflicts.
sebastianbochan Jul 6, 2026
dc2402b
Added basic pagination component.
sebastianbochan Jul 6, 2026
5841659
Cleaned up.
sebastianbochan Jul 6, 2026
c6ad53e
Added header component.
sebastianbochan Jul 6, 2026
85b3a1d
Added base for tailwind styling.
sebastianbochan Jul 7, 2026
170162f
Merge pull request #15 from highcharts/components/columns-column
sebastianbochan Jul 7, 2026
fe9d136
Init changes for tailwind.
sebastianbochan Jul 8, 2026
68bed84
Merge branch 'components/header' into grid/jsx-components
sebastianbochan Jul 8, 2026
605ce6c
Added pagination position.
sebastianbochan Jul 8, 2026
9486a21
Merge pull request #19 from highcharts/components/pagination-position
sebastianbochan Jul 8, 2026
76f09c9
Optymized pagination position.
sebastianbochan Jul 8, 2026
6d16a75
Added components tests.
sebastianbochan Jul 8, 2026
3796a7e
Added linter to PR runner.
sebastianbochan Jul 8, 2026
aa121c8
Rephrased rules in linter.
sebastianbochan Jul 8, 2026
0e1a909
Added husky precommit action.
sebastianbochan Jul 9, 2026
7b50a33
Linted.
sebastianbochan Jul 9, 2026
108a85a
Linted useGrid hook.
sebastianbochan Jul 9, 2026
bfc063a
Fixed packages.
sebastianbochan Jul 9, 2026
9dd5e0e
Linted Grid.
sebastianbochan Jul 9, 2026
2ade77e
Cleaned up.
sebastianbochan Jul 9, 2026
8bcf49e
Added Caption test.
sebastianbochan Jul 9, 2026
41c7bf5
Added Description test.
sebastianbochan Jul 9, 2026
0c97316
Added tests for Coolumns and ColumnDefaults.
sebastianbochan Jul 10, 2026
2390f54
Merge pull request #20 from highcharts/grid/tests
sebastianbochan Jul 10, 2026
9da7362
Updated linter, linted nextjs demo.
sebastianbochan Jul 13, 2026
5979dd9
Linted.
sebastianbochan Jul 13, 2026
e39a003
Added grid-pro demo.
sebastianbochan Jul 13, 2026
01835c5
Refactored shared utils and hooks.
sebastianbochan Jul 14, 2026
9df999f
Added mappers and builders.
sebastianbochan Jul 15, 2026
2c5013f
Added exports.
sebastianbochan Jul 15, 2026
6f793d3
Fixed Grid main component.
sebastianbochan Jul 15, 2026
e492b04
Fixed Grid main component.
sebastianbochan Jul 15, 2026
9cd42b1
Added tests.
sebastianbochan Jul 15, 2026
d9b8baa
Fixed conflicts.
sebastianbochan Jul 15, 2026
b3ca925
Fixed conflicts.
sebastianbochan Jul 15, 2026
3a87695
Fixed broken linter and tests.
sebastianbochan Jul 15, 2026
6b37416
Merge pull request #21 from highcharts/components/grid-pro
sebastianbochan Jul 16, 2026
dcffc46
Fixed condlicts.
sebastianbochan Jul 16, 2026
f7cd0ee
Merge branch 'grid/jsx-components' into stylinh/tailwind
sebastianbochan Jul 16, 2026
e4628a1
Added tailwind classes to grid-lite demo.
sebastianbochan Jul 29, 2026
60aeada
Update grid-lite and grid-pro packages to 3.1.0.
sebastianbochan Aug 10, 2026
815428e
Merge pull request #23 from highcharts/grid/update-packages
sebastianbochan Aug 10, 2026
35a7a14
Updated mappers and builders.
sebastianbochan Aug 10, 2026
ae6dea0
Updated CSS and package.json.
sebastianbochan Aug 10, 2026
f5f5ce7
Fixed styles, mappers.
sebastianbochan Aug 10, 2026
cf2fed6
Fixed Grid component and the base.
sebastianbochan Aug 11, 2026
bcc2054
Fixed pagination and ColumnDefaults.
sebastianbochan Aug 11, 2026
efcd818
Added tests.
sebastianbochan Aug 11, 2026
8fd733c
Merge pull request #18 from highcharts/stylinh/tailwind
sebastianbochan Aug 12, 2026
31051aa
Redesigned README.md files.
sebastianbochan Aug 13, 2026
eb7036e
Added backward compatibility path to use Grid.
sebastianbochan Aug 13, 2026
bcfb95b
Merge pull request #24 from highcharts/grid/readme-update
sebastianbochan Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
name: Tests
name: CI

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run linter
run: pnpm lint

test:
runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm lint
pnpm test
206 changes: 121 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
# Highcharts Grid React

Monorepo containing React packages for [Highcharts Grid Lite](https://www.highcharts.com/docs/grid/getting-started/grid-lite) and [Highcharts Grid Pro](https://www.highcharts.com/docs/grid/getting-started/grid-pro).
<div align='center'>

## Packages
<i>Official Highcharts Grid for React</i>

<img src="https://assets.highcharts.com/images/highcharts-logo.svg" />

<p>Official React packages for Highcharts Grid Lite and Highcharts Grid Pro. Built for React patterns, with a JSX-native API, TypeScript types, and the Grid CSS included.</p>

<img src="https://img.shields.io/npm/v/%40highcharts%2Fgrid-lite-react?style=flat&logoColor=white&label=grid-lite-react&labelColor=2a2a2a&color=e53e3e" alt="Grid Lite React NPM Version" />
<img src="https://img.shields.io/npm/v/%40highcharts%2Fgrid-pro-react?style=flat&logoColor=white&label=grid-pro-react&labelColor=2a2a2a&color=e53e3e" alt="Grid Pro React NPM Version" />
<img src="https://img.shields.io/discord/1318933807059042305?style=flat&logoColor=white&label=discord&labelColor=2a2a2a&color=5865F2" alt="Discord" />

</div>

This is the working repository for the Grid React packages. If you want to use Grid in a React app, install a distribution package from npm rather than this repo.

## Why Highcharts Grid React?

- **Options or JSX** - Pass a Grid `options` object, compose with React components such as `Data`, `Column`, `Caption`, and `Pagination`, or mix both
- **Lite and Pro** - Start with free Grid Lite, or use Grid Pro for editing, validation, sparklines, and events
- **Self-Contained Packages** - Grid setup, cleanup, and CSS are handled for you
- **Built for Large Tables** - Row virtualization keeps scrolling smooth with thousands of records
- **Accessibility First** - Semantic HTML tables with keyboard navigation and screen reader support
- **TypeScript Ready** - First-class types for options, refs, events, and component props

This monorepo contains the following packages:
## Packages

### Published Packages

Expand All @@ -15,9 +36,7 @@ This monorepo contains the following packages:

- **[@highcharts/grid-shared-react](./packages/grid-shared-react/)** - Shared core functionality used by both Grid Lite and Grid Pro React packages

## Quick Start

### Installation
## Installation

```bash
# For Grid Lite
Expand All @@ -27,17 +46,24 @@ npm install @highcharts/grid-lite-react
npm install @highcharts/grid-pro-react
```

### Usage
> **Note:** The matching Grid Core package is included as a dependency. `react` and `react-dom` are peer dependencies and are installed automatically with npm v7+. Requires React 18 or higher.

## Quick Start

Components are optional. You can pass a Grid `options` object to `<Grid>` the same way as before, use JSX components, or mix both.

#### Grid Lite
### Grid Lite

```tsx
import React, { useState } from 'react';
Using options:

```jsx
import { useState } from 'react';
import { Grid, type GridOptions } from '@highcharts/grid-lite-react';

function App() {
export function App() {
const [options] = useState<GridOptions>({
dataTable: {
caption: { text: 'Team directory' },
data: {
columns: {
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45]
Expand All @@ -49,57 +75,98 @@ function App() {
}
```

#### Grid Pro
Using components:

```jsx
import { Grid, Caption, Data, Column } from '@highcharts/grid-lite-react';

export function App() {
return (
<Grid>
<Caption>Team directory</Caption>
<Data
columns={{
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45]
}}
/>
<Column columnId="name" headerFormat="Name" />
<Column columnId="age" dataType="number" headerFormat="Age" />
</Grid>
);
}
```

### Grid Pro

Using options:

```tsx
import React, { useState } from 'react';
```jsx
import { useState } from 'react';
import { Grid, type GridOptions } from '@highcharts/grid-pro-react';

function App() {
export function App() {
const [options] = useState<GridOptions>({
dataTable: {
caption: { text: 'Team directory' },
data: {
columns: {
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45]
}
}
});

return <Grid options={options} />;
return <Grid gridKey="YOUR-GRID-KEY" options={options} />;
}
```

Using components:

```jsx
import { Grid, Caption, Data, Column } from '@highcharts/grid-pro-react';

export function App() {
return (
<Grid gridKey="YOUR-GRID-KEY">
<Caption>Team directory</Caption>
<Data
columns={{
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45]
}}
/>
<Column columnId="name" headerFormat="Name" />
<Column columnId="age" dataType="number" headerFormat="Age" />
</Grid>
);
}
```

See the package READMEs for TypeScript, refs, Next.js, and more:

- [Grid Lite React](./packages/grid-lite-react/README.md)
- [Grid Pro React](./packages/grid-pro-react/README.md)

## Repository Structure

```
highcharts-grid-react/
├── packages/ # Source packages
│ ├── grid-lite-react/ # Grid Lite React package
│ ├── grid-pro-react/ # Grid Pro React package
│ └── grid-shared-react/ # Shared core functionality
│ └── grid-shared-react/ # Shared core functionality
├── examples/ # Example applications
│ ├── grid-lite/ # Grid Lite examples
│ │ ├── minimal-react/ # Minimal React example (Vite)
│ │ ├── components-react/ # JSX component API example (Vite)
│ │ └── minimal-nextjs/ # Minimal Next.js example
│ └── grid-pro/ # Grid Pro examples
│ ├── minimal-react/ # Minimal React example (Vite)
│ └── minimal-nextjs/ # Minimal Next.js example
│ ├── components-react/ # JSX component API example (Vite)
│ └── minimal-nextjs/ # Minimal Next.js example
└── README.md # This file
```

### Packages

- **`packages/grid-lite-react/`** - React component package for Highcharts Grid Lite. See [README](./packages/grid-lite-react/README.md) for details.
- **`packages/grid-pro-react/`** - React component package for Highcharts Grid Pro. See [README](./packages/grid-pro-react/README.md) for details.
- **`packages/grid-shared-react/`** - Internal package containing shared React components and hooks used by both packages.

### Examples

- **`examples/grid-lite/minimal-react/`** - Minimal React application (Vite) demonstrating how to use `@highcharts/grid-lite-react`
- **`examples/grid-lite/minimal-nextjs/`** - Minimal Next.js application demonstrating how to use `@highcharts/grid-lite-react`
- **`examples/grid-pro/minimal-react/`** - Minimal React application (Vite) demonstrating how to use `@highcharts/grid-pro-react`
- **`examples/grid-pro/minimal-nextjs/`** - Minimal Next.js application demonstrating how to use `@highcharts/grid-pro-react`

## Development

This is a monorepo managed with [pnpm workspaces](https://pnpm.io/workspaces).
Expand Down Expand Up @@ -131,6 +198,10 @@ To run the example applications:
cd examples/grid-lite/minimal-react
pnpm dev

# Run Grid Lite JSX components example
cd examples/grid-lite/components-react
pnpm dev

# Run Grid Lite Next.js example
cd examples/grid-lite/minimal-nextjs
pnpm dev
Expand All @@ -139,6 +210,10 @@ pnpm dev
cd examples/grid-pro/minimal-react
pnpm dev

# Run Grid Pro JSX components example
cd examples/grid-pro/components-react
pnpm dev

# Run Grid Pro Next.js example
cd examples/grid-pro/minimal-nextjs
pnpm dev
Expand All @@ -148,64 +223,25 @@ Note: Since all examples are part of the pnpm workspace, dependencies are instal

## Next.js Integration

Highcharts Grid React components can be used in Next.js applications. Since the Grid components require browser APIs, they need to be rendered on the client side only (without Server-Side Rendering).

### Setup

1. Install the required packages:

```bash
npm install @highcharts/grid-lite-react @highcharts/grid-lite
# or
npm install @highcharts/grid-pro-react @highcharts/grid-pro
```

2. Import the Grid component dynamically with SSR disabled:

```tsx
'use client';

import { useState } from 'react';
import dynamic from 'next/dynamic';
import { type GridOptions } from '@highcharts/grid-lite-react';
import '@highcharts/grid-lite/css/grid-lite.css';

// Disable SSR for the Grid component
const Grid = dynamic(
() => import('@highcharts/grid-lite-react').then((mod) => mod.Grid),
{ ssr: false }
);
Highcharts Grid React components can be used in Next.js applications. Grid uses browser APIs, so it must render on the client. See the [Next.js guide](https://www.highcharts.com/docs/grid/frameworks/nextjs) and the package READMEs for a complete example.

export default function Page() {
const [options] = useState<GridOptions>({
dataTable: {
columns: {
name: ['Alice', 'Bob', 'Charlie'],
age: [23, 34, 45]
}
}
});

return <Grid options={options} />;
}
```
## Documentation

### Important Notes
- [Grid Lite React](./packages/grid-lite-react/README.md)
- [Grid Pro React](./packages/grid-pro-react/README.md)
- [Highcharts Grid with React](https://www.highcharts.com/docs/grid/frameworks/react)
- [Highcharts Grid Lite](https://www.highcharts.com/docs/grid/getting-started/grid-lite)
- [Highcharts Grid Pro](https://www.highcharts.com/docs/grid/getting-started/grid-pro)
- [Changelog](./CHANGELOG.md)
- [Releasing](./RELEASING.md)

- **SSR is disabled**: The Grid components require browser APIs and cannot be rendered on the server. They are dynamically imported with `ssr: false` to ensure client-side only rendering.
- **Client Component**: The page or component using the Grid must be marked with `'use client'` directive.
- **CSS Import**: Don't forget to import the required CSS file for the Grid component.
## Support and feedback

See the [Next.js examples](./examples/) for complete working implementations.
We love to learn how you are using Highcharts, and what you would like to see from us in the future.

## Documentation
Join our vibrant community on [GitHub](https://github.com/highcharts/grid-react), [Stack Overflow](https://stackoverflow.com/tags/highcharts/), [Discord](https://discord.com/invite/xHxxcyyy6K), and the [Highcharts Forums](https://www.highcharts.com/forum/).

- [Grid Lite React Documentation](./packages/grid-lite-react/README.md)
- [Grid Pro React Documentation](./packages/grid-pro-react/README.md)
- [Highcharts Grid Lite Documentation](https://www.highcharts.com/docs/grid/getting-started/grid-lite)
- [Highcharts Grid Pro Documentation](https://www.highcharts.com/docs/grid/getting-started/grid-pro)
- [Changelog](./CHANGELOG.md)
- [Releasing](./RELEASING.md)
Commercial support packages are available, see [Highcharts Advantage](https://www.highcharts.com/highcharts-advantage/).

## License

Expand Down
20 changes: 17 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import globals from 'globals';

export default defineConfig(
{
ignores: ['**/dist/**', '**/build/**'],
ignores: [
'**/dist/**',
'**/build/**',
'**/.next/**',
'**/node_modules/**'
],
},
eslint.configs.recommended,
tseslint.configs.recommended,
Expand All @@ -17,15 +22,24 @@ export default defineConfig(
},
rules: {
'curly': ['error', 'all'],
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_'
}],
'@stylistic/semi': ['error', 'always'],
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'@stylistic/eol-last': ['error', 'always'],
'@stylistic/no-trailing-spaces': ['error']
'@stylistic/no-trailing-spaces': ['error'],
'@stylistic/max-len': ['error', {
code: 80,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true
}]
},
},
{
files: ['scripts/**/*.js'],
files: ['scripts/**/*.js', '**/next.config.js'],
languageOptions: {
globals: {
...globals.node,
Expand Down
13 changes: 13 additions & 0 deletions examples/grid-lite/components-react/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Highcharts Grid Lite - React Example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

Loading