Examples

Runnable demo apps for @visulima/tui React mode and raw-buffer mode

Examples

All examples in this page are part of this repository.

Run from repository root:

node --import @oxc-node/core/register examples/<name>.tsx
node --import @oxc-node/core/register examples-raw/<name>.ts

React Mode (examples/)

Basics

FileWhat it demonstrates
counter.tsxuseState + useInput minimal app
use-input.tsxKey parsing: arrows, ctrl/meta combos, special keys
borders.tsxBorder styles: single, double, round, bold, classic
box-backgrounds.tsxBackground colors
justify-content.tsxFlex alignment and spacing
terminal-resize.tsxuseWindowSize with live resize behavior
htop.tsxhtop-style system monitor (Unix-like; uses ps aux)

Input and Interaction

FileWhat it demonstrates
cursor-input/cursor-input.tsxDeclarative <Cursor /> inline text input
cursor-ime.tsxuseCursor() with IME and wide character support
use-focus.tsxuseFocus + Tab cycling
use-focus-with-id.tsxNamed focus targets + focus(id)
use-mouse.tsxuseMouse buttons, wheel, modifiers
use-paste.tsxusePaste routing vs useInput fallback

Layout and Composition

FileWhat it demonstrates
use-scrollable.tsxuseScrollable viewport state + sliced rendering
static.tsx<Static> append-only output
chat.tsxChat-style history + live input

Components

FileWhat it demonstrates
spinner.tsx<Spinner> defaults + custom frames
progress-bar.tsx<ProgressBar> states and options
kitchen-sink.tsxMulti-feature demo in one app

Async and React Features

FileWhat it demonstrates
suspense.tsxSuspense with async data
concurrent-suspense.tsxConcurrent rendering behavior
use-transition.tsxuseTransition
incremental-rendering.tsxFrequent partial updates
sierpinski.tsxFiber-heavy animated tree

Inline Mode

FileWhat it demonstrates
inline-minimal.tsxMinimal renderInline() usage
inline-picker.tsxInline picker UI

Ratatat-Specific Demos

FileWhat it demonstrates
logo.tsxonBeforeFlush direct buffer overlays
rattata.tsxStreaming fake-assistant demo
stress-test.tsx~700 FPS sustained full-terminal animation

Raw-Buffer Mode (examples-raw/)

FileWhat it demonstrates
ascii-3d.tsSpinning ASCII-shaded 3D cube with z-buffer
matrix.tsMatrix rain
conway.tsConway's Game of Life
plasma.tsPlasma effect
fire.tsFire effect
jitter.tsFrame-time oscilloscope
scope.tsMulti-harmonic oscilloscope
inline-picker.tsInline picker without React

All raw examples use examples-raw/harness.ts.

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues