Skip to main content

Tairu packages

Tiles handling

The following packages provide APIs to create Tile handlers, that can be served over HTTP using the Tairu CLI or a Node.js HTTP server.

@tairu/handler

This is the main package to use when getting started with Tairu. It enables to create handlers serving JSON Tiles, but also rendering as HTML and SVG.

@tairu/json-handler

APIs to create handlers for JSON Tiles only. The @tairu/handler package should be used instead for rendering HTML and SVG.

Tiles rendering

The following packages provide APIs to load, display and interact with Tiles on clients.

@tairu/web-client

Main client for supporting Tiles in DOM environments, allowing to add interactions to prerendered Tiles or fully loading and rending Tiles by URL.

@tairu/jquery

jQuery plugin for interacting with Tiles.

@tairu/react-dom

High-level logic for supporting Tiles in clients using React for DOM environments. The @tairu/react-dom/server export can also be used to support React Server Components.

@tairu/react-native

High-level logic for supporting Tiles in clients using React Native.

Integrations

@tairu/next

High-level integration for the Next.js React framework. This package exports a Tile component that can be used to simply integrate Tiles in a Next.js application, supporting Server Components rendering.

The @tairu/next/server export can also be used to create Tile handlers as Next.js Route Handlers.

Utilities

These are low-level packages mainly used to provide common logic for the higher-level packages supporting Tiles handling and rendering.

@tairu/protocol

The schemas and types implementing the Tairu protocol.

@tairu/loader

APIs to interact with Tile handlers by loading Tiles and posting actions.

@tairu/renderer

This package provides the base class that needs to be extended to implement platform-specific rendering logic. In most cases, the high-level Tiles rendering packages should be used instead of this package.

@tairu/testing

This package provides a TestAgent class that can be used to interact with Tile handlers in tests with minimal setup.

@tairu/jsx

Utilities to convert JSX elements to the JSON Tile structure, allowing to use the JSX syntax as an abstraction in Tile handlers.

@tairu/react

Generic rendering logic for React, used by the @tairu/react-dom and @tairu/react-native packages.