---
title: "Examples"
description: "Terminal apps, written in TypeScript and compiled to native executables with scriptc."
canonical_url: "https://tui-sdk.dev/docs/examples"
---
# Examples

Each app below is one TypeScript file in the repository's `examples` directory, running in your browser. The same file runs with Node.js and builds to a native executable with scriptc.

<Showpiece
  name="fireworks"
  title="Fireworks"
  line="Fireworks over a bay at night, with a skyline and its reflection in the water."
  size="fine"
  rows={50}
/>

<Showpiece
  name="koi"
  title="Koi pond"
  line="A pond seen from above. Click to drop food and the fish swim to it."
  size="fine"
  rows={50}
/>

<Showpiece
  name="shooter"
  title="Vault shooter"
  line="A first-person shooter, raycast per pixel. Click it, walk with W, turn with A and D, fire with Space."
  size="fine"
  rows={50}
/>

<Showpiece
  name="regions"
  title="Deploy globe"
  line="A deployment reaching six regions as arcs over a lit globe, with each region's latency."
  size="fine"
  rows={50}
/>

<Showpiece
  name="dashboard"
  title="Dashboard"
  line="A live dashboard, every pixel drawn again each frame. Move the pointer over the chart."
  size="mid"
  rows={42}
/>

<Showpiece
  name="ink"
  title="Ink"
  line="A fluid simulation that carries ink over paper. Move the pointer to stir it."
  size="fine"
  rows={50}
/>

<Showpiece
  name="runner"
  title="Aisle runner"
  line="A run down a server aisle. Click it, then steer with Left and Right."
  size="fine"
  rows={50}
/>

<Showpiece
  name="radar"
  title="Storm radar"
  line="A weather radar with a storm, a sweeping beam, lightning, and wind barbs."
  size="fine"
  rows={50}
/>

<Showpiece
  name="desktop"
  title="Tiny desktop"
  line="Four overlapping windows. Click one to bring it forward, and drag it by its title bar."
  size="fine"
  rows={50}
/>

<Showpiece
  name="graph"
  title="Dependency graph"
  line="A monorepo's packages as a graph on springs. Drag a package, or point at one to light what depends on it."
  size="fine"
  rows={50}
/>

<Showpiece
  name="rollout"
  title="Rolling deploy"
  line="A rolling deploy across nine nodes, drawn as blocks seen from above."
  size="fine"
  rows={50}
/>

<Showpiece
  name="ridgeline"
  title="Latency ridgeline"
  line="Latency histograms as ridges of braille dots that move back as new ones arrive."
  size="fine"
  rows={50}
/>

<Showpiece
  name="trace"
  title="Trace zoom"
  line="A request's trace as spans on a timeline. The wheel zooms, a drag pans, and hovering names a span."
  size="mid"
  rows={38}
/>

<Showpiece
  name="assistant"
  title="Chat"
  line="A chat that asks a question and streams a Markdown answer. Click it and type a message of your own."
  rows={30}
/>

<Showpiece
  name="logs"
  title="Logs"
  line="A live request log in columns. Click it and type to filter it, for example status:500."
  rows={30}
/>

<Showpiece
  name="finder"
  title="Command palette"
  line="A palette over 12,480 files and commands, searched on every key. Click it and type."
  rows={30}
/>

<Showpiece
  name="deploy"
  title="Deploy command"
  line="An inline command: a list, checkboxes, an input, then steps with their timings."
  rows={18}
/>

## More examples

The `examples` directory has more files, one per feature. Run any of them from a clone of the repository:

```console
$ node examples/earth.ts
$ npx scriptc build examples/earth.ts -o earth
```

| Example         | What it shows                                                                                         |
| --------------- | ----------------------------------------------------------------------------------------------------- |
| `components.ts` | A Listbox, Tabs, an Input, a Table, and a Dialog on one screen, each changing what the others show.   |
| `markdown.ts`   | A message that streams in as Markdown: a heading, lists, a code block, and a table.                   |
| `prompts.ts`    | Text, select, and confirm prompts, then spinners and progress bars, below the cursor.                 |
| `events.ts`     | Every key with its modifiers, pastes, clicks, and the wheel, beside the bytes each arrived as.        |
| `unicode.ts`    | Wide characters, emoji sequences, flags, keycaps, and combining marks, one cluster to a cell.         |
| `earth.ts`      | A lit Earth, a color for every pixel, with clouds, city lights at night, and requests between cities. |
| `maze.ts`       | A first-person walk through a hall of light, raycast and shaded per pixel.                            |
| `fluid.ts`      | A fluid simulation that carries colored ink, stirred by the pointer.                                  |
| `driven.ts`     | A file picker, and an agent using it through `snapshot` and `act`.                                    |
| `agent-chat.ts` | A coding agent's chat: tools that run, and an answer that streams in as Markdown.                     |
| `million.ts`    | A million-line log that adds lines and filters while you type.                                        |
| `ember.ts`      | A cave shooter in pixel art: sprites, a tilemap, a camera, collision, and a fixed step.               |
| `shader.ts`     | A ray marched torus, a tunnel, and a plasma, at a frame rate.                                         |
| `glide.ts`      | Springs and transitions: a gliding highlight, a sliding panel, counting numbers, and moving rows.     |
| `globe.ts`      | A globe in braille dots, with requests arcing between cities.                                         |
| `hello.ts`      | A chat with an input at the bottom and a log that stays at its newest line.                           |
| `keys.ts`       | The terminal and cells without `runApp`: a box, a line being typed, and every key that arrives.       |
| `picker.ts`     | An input that filters a list, tabs, a scroll log, a dialog that adds an item, and an agent server.    |
| `prompt.ts`     | Text, select, confirm, and spinner prompts, then their answers.                                       |
| `chat.ts`       | A textarea that grows with its text, and a Markdown transcript that follows the newest lines.         |
| `agent.ts`      | A list app that agents can read and act on through MCP.                                               |
| `table.ts`      | A table of runs, with a row picked and a value copied to the clipboard.                               |
| `motion.ts`     | Balls on a canvas, a chart, a meter, a sparkline, and movement while keys are held.                   |
| `image.ts`      | A Mandelbrot image from a pixel buffer.                                                               |
