Skip to content

Latest commit

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

hyper-xl

Excel-like grid component library for React. Inject your own cell renderers and keep the spreadsheet engine out of your application code.

Virtualized rendering with selection, editing, clipboard, fill, sort and filter, find and replace, zoom, annotations, protection, aggregation, pivot tables, conditional formatting, cell visual formatting, and Excel (xlsx) import/export.

Distribution notice. This package ships a prebuilt, minified bundle. The core engine source is not included. See License below: free for evaluation and non-commercial use, commercial use requires a separate license.

📖 Documentation:https://hyperez.github.io/hyper-xl/ (full API reference + install guide). Live demo:https://hyperez.github.io/hyper-xl/app/ (interactive grid + live code editor).

Install

npm install hyper-xl
# or
pnpm add hyper-xl
# or
yarn add hyper-xl

Peer dependencies

react and react-dom are required peers. exceljs is an optional peer, needed only if you import the Excel helpers from hyper-xl/exceljs.

npm install react react-dom
npm install exceljs # optional, only for xlsx import/export
PeerRangeRequired
react^18.0.0 || ^19.0.0yes
react-dom^18.0.0 || ^19.0.0yes
exceljs^4.4.0optional (only for hyper-xl/exceljs)

Usage

import{useState}from'react';import{CellFormatToolbar,XlReact,cellFormatKey,typeCellFormatsMap,typeColumn,typeRow,typeSelectionSnapshot,}from'hyper-xl';import'hyper-xl/styles.css';import'hyper-xl/themes/light.css';constcolumns: Column[]=[{id: 'name',header: 'Name',accessor: (r)=>r.data.name},{id: 'qty',header: 'Qty',accessor: (r)=>r.data.qty},];constrows: Row[]=[{id: 1,data: {name: 'Container A',qty: 12}},{id: 2,data: {name: 'Container B',qty: 8}},];constinitialCellFormats: CellFormatsMap={[cellFormatKey(0,1)]: {align: {horizontal: 'right'},font: {family: 'Consolas, monospace'},},};exportfunctionPage(){const[selection,setSelection]=useState<SelectionSnapshot|null>(null);const[cellFormats,setCellFormats]=useState<CellFormatsMap>(initialCellFormats);return(<><CellFormatToolbarselection={selection}cellFormats={cellFormats}onCellFormatsChange={setCellFormats}/><XlReactcolumns={columns}rows={rows}cellFormats={cellFormats}onSelectionChange={setSelection}/></>);}

CellFormatToolbar edits the sparse CellFormatsMap form. The resolver form of cellFormats is useful for read-only derived formatting; apps that edit formats through the built-in toolbar should keep a map-backed state.

Custom cell rendering

constcolumns: Column[]=[{id: 'qty',header: 'Qty',accessor: (r)=>r.data.qtyasnumber,cellRenderer: ({ value })=><strong>{value.toLocaleString()}</strong>,cellEditor: ({ value, onCommit, onCancel })=>(<inputdefaultValue={String(value)}onBlur={(e)=>onCommit(Number(e.target.value))}onKeyDown={(e)=>e.key==='Escape'&&onCancel()}autoFocus/>),},];

Entry points

Import pathContents
hyper-xlGrid component, hooks, formatting utilities, and types
hyper-xl/exceljsLow-level ExcelJS helpers (requires the exceljs peer)
hyper-xl/pivot/presetsPivot presets and the generic PivotPreset<Id> shape
hyper-xl/styles.cssRequired base stylesheet (tokens + class rules)
hyper-xl/themes/light.cssOptional light theme token overrides

Public API (highlights)

The most common exports are listed below; the package ships full TypeScript declarations, so your editor surfaces the complete API on import.

ExportKindNotes
XlReactcomponentVirtualized Excel-like grid component
CellFormatToolbarcomponentControlled toolbar for editing selected cell formats
FormulaBarcomponentControlled formula/value bar bound to the active selection
XlReactPropstypeControlled grid props: rows, columns, callbacks, formats
Column<T>typeid, header, accessor, optional cellRenderer / cellEditor
Rowtype{ id, data } where data is Record<string, unknown>
CellFormattypeCell-level visual formatting model (font / alignment / fill / border)
CellFormatsMaptypeSparse ${row}:${col} map for per-cell formats
cellFormatKeyutilityBuilds the ${row}:${col} key used by CellFormatsMap
applyCellFormatPatchutilityApplies a format patch across selected ranges
applyCellBorderPatchutilityApplies Excel-style range border commands
computeAggregatesutilityComputes aggregate values over a selection

CSS

The library ships CSS as standalone files only. The JS entry does not side-effect-import any CSS, which keeps Next.js and other "no global CSS from node_modules" bundlers happy and avoids double-loading. Import the stylesheet explicitly:

import'hyper-xl/styles.css';// requiredimport'hyper-xl/themes/light.css';// optional theme

All visible styles are driven by --xl-react-* CSS variables, so apps can override individual tokens without touching the bundle.

Requirements

  • Node >=20
  • React 18 or 19

License

hyper-xl is distributed under the HyperEZ Source-Available License (see LICENSE).

  • Evaluation, learning, and non-commercial use: permitted at no cost.
  • Commercial or production use: requires a separate commercial license.

To obtain a commercial license, or for any licensing question, contact support@hyperez.io.

Copyright (c) 2026 HyperEZ Inc. (주식회사 하이퍼이지). All rights reserved.

About

Excel-like grid component library for React (prebuilt, source-available). npm i hyper-xl

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors