Component library / Web + TUI

One component, two renderers.

One shared model drives both web and TUI renderers. The two views are in sync. Reset examples to return both to their starting values. Explore components that work in both web and TUI environments. The same libraries, hooks, functions, data, state, and types drive both; only the rendering component changes. This includes Tanstack libraries like Query, Table, Router etc.

Display

Cycleable date & time

Display one timestamp as UTC, relative time, or local time. Controlled providers share the chosen format between the web and terminal previews.

Web

React DOM

Click the date to cycle formats. The tooltip names the current format.

Terminal

Ink + xterm.js

Loading terminal…

Click the terminal and press Enter to cycle UTC → relative → local. Use Tab to leave the terminal.

Wrap dates in CycleableDateTimeProvider. Web relative labels refresh every 30 seconds; terminal labels refresh when the TUI renders.