Headless engine

Headless engine

Build a custom renderer over Pretable's indexed row model and UI-state grid.

@pretable/core separates two framework-independent stores — createLocalRowModel owns rows, filters, sorting, grouping, aggregation, and expansion; createGrid adds optional UI state such as focus, selection, editing, viewport, and visual column layout. Neither renders DOM or requires React. Below is a complete renderer built on nothing but those two stores and <table>:

Headless custom renderer

Drive your own markup from the @pretable/core row model with useSyncExternalStore — no grid renderer involved.

.md

Sorting the columns, filtering by team, and selecting a row are all driven by rowModel and grid directly — there is no <PretableSurface> anywhere in this file. First headless grid walks through how it's built.

When to reach for it

Use @pretable/core directly for a canvas renderer, another framework, or custom markup. If you only need a React grid, pass rows and columns to <PretableSurface>; it creates and maintains the local row model for you.

Install

Terminal
npm i @pretable/core

Next

First headless grid

Create a local row model, subscribe to it, and render an indexed range.