npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tkz-tab-react

v0.2.1

Published

A compilation-free React component to render LaTeX tkz-tab mathematical variation and sign tables using KaTeX and SVG.

Readme

🚀 VariationTable

VariationTable is a high-performance React component designed to render LaTeX tkz-tab variation and sign tables directly in the browser, with no server-side compilation required.

A demo is available here.


💡 Why this project?

The LaTeX tkz-tab package is the standard for creating complex mathematical tables, but its usage is typically confined to the LaTeX ecosystem.

On the web, there is no lightweight, native solution to display these tables. I developed VariationTable to:

  • Bridge the gap: Enable educators and developers to render mathematical tables without the need for static image generation or heavy PDF exports.
  • Performance: Achieve instant rendering through a dedicated parsing engine.

⚙️ Architecture & Functionality

The engine follows a three-stage pipeline:

  1. Parsing (Peggy.js): The source tkz-tab code is parsed to generate an Abstract Syntax Tree (AST).
  2. Transformation: An intermediate layer converts the AST into a structured data format tailored for React.
  3. Multi-layer Rendering:
  • Math Layer: Utilizes KaTeX for high-fidelity mathematical typography.
  • SVG Layer: Handles the drawing of arrows, forbidden regions, and the table outline.
  • Note: Arrows are rendered after measuring label dimensions to ensure precise, geometrically accurate positioning.

🛠 Integration Guide

Installation

VariationTable uses KaTeX to render math, but does not bundle it — you need to install it alongside as a peer dependency:

# npm
npm install tkz-tab-react katex

# yarn
yarn add tkz-tab-react katex

# pnpm
pnpm add tkz-tab-react katex

Basic Usage

import "tkz-tab-react/style.css";
import 'katex/dist/katex.min.css'; // required — see Installation
import {VariationTable} from 'tkz-tab-react'

const MyComponent = () => {
  const latexCode = `\\begin{tikzpicture} ... \\end{tikzpicture}`;
  
  return <VariationTable inputText={latexCode} theme="dark"/>;
};

Theme can be light or dark and is optional.

If a syntax or logic error is detected, the component automatically displays a descriptive error message instead of the table.


🔌 Compatibility & Divergences

  • Coverage: It supports the vast majority of standard use cases handled by the original tkz-tab package.
  • Error Handling: Unlike tkz-tab, which can fail silently or render broken outputs, it explicitly throws descriptive error messages pinpointing the source of failure.
  • Line Breaks: It does not support raw \\ line breaks outside of math mode ($...$).
  • Math Rendering: It uses KaTeX to render mathematical expressions; please refer to the KaTeX Supported Features for valid commands.
  • Peer dependencies: requires react/react-dom ≥18 and katex installed separately in your project (not bundled).

📈 To Do

  • [ ] Implement support for optional arguments to controle table dimensions.
  • [ ] Fully support tkzTabSlope and tkzTab short hand initialisation command.

📄 License

This project is licensed under the MIT License.