@tty-pt/hyle-react

npm version License: BSD-2-Clause React: >=18.0.0 TypeScript: Ready

Unopinionated, pluggable React 19 components and substrate cache hooks for Hyle datasets.

๐Ÿ“– Full Documentation & Source: See the main libhyle-react GitHub README.


1. Installation

npm config set @tty-pt:registry https://tty.pt/npm/
npm install @tty-pt/hyle-react @tty-pt/hyle @tty-pt/hyle-source

2. Quickstart

import React from "react";
import { HyleTable, HylePagination, useHyleDataset } from "@tty-pt/hyle-react";

export function MemberList() {
  const { data: members, total, page, perPage, setPage } = useHyleDataset({
    dataset: "members",
    query: "active=1",
    initialPage: 1,
    perPage: 25
  });

  return (
    <div className="space-y-4">
      <HyleTable
        items={members}
        columns={[
          { key: "fullName", label: "Full Name" },
          { key: "email", label: "Email Address" },
          {
            key: "credits",
            label: "Credits",
            cell: (row) => <span className="font-mono">{row.credits}</span>
          }
        ]}
        tableClassName="w-full text-left text-sm border-collapse"
        headerRowClassName="border-b border-neutral-200 uppercase text-xs"
        rowClassName={(row) => "hover:bg-neutral-50 transition-colors"}
      />

      <HylePagination
        total={total}
        page={page}
        perPage={perPage}
        onPageChange={setPage}
      />
    </div>
  );
}

3. Core Components

<HyleTable>

Unopinionated semantic table component mirroring libhyle-bud. Supports explicit columns or schema-driven auto columns with columnOverrides:

<HylePagination>

Framework-agnostic page stepper and per-page selector:

<HyleFilterBar>

Search input and active filter badge container:

<HyleForm>, <HyleField>, <HyleInput>

Declarative form primitives connecting directly to Hyle schema purification rules (hyle_purify_row).


4. Hooks

useHyleDataset(options)

React 19 native hook utilizing useSyncExternalStore connected directly to @tty-pt/hyle-source's in-memory substrate cache:

useHyleTable(options)

Table state management hook for canonical query serialization and sort state toggling.


License

BSD-2-Clause โ€” Copyright (c) 2026, Paulo Quirino <quirinpa@gmail.com>. See LICENSE.

Documentation