xonecas.io
70160
Ce

cel-tui / files

cel-tui / packages / core / README.md

892 bytes
1# @cel-tui/core
2
3The rendering, layout, terminal, focus, input, and primitive layer of
4[cel-tui](https://github.com/sacenox/cel-tui).
5
6```bash
7bun add @cel-tui/core
8```
9
10```ts
11import { cel, ProcessTerminal, Text, VStack } from "@cel-tui/core";
12
13cel.init(new ProcessTerminal());
14cel.viewport(() =>
15  VStack({ width: "100%", height: "100%" }, [
16    Text("Hello from cel-tui", { bold: true }),
17  ]),
18);
19```
20
21The framework exposes four primitives: `VStack`, `HStack`, `Text`, and
22`TextInput`. Application state stays external; update it and call
23`cel.render()`. Focus and scrolling are framework-managed unless their
24controlled props are supplied.
25
26The package ships TypeScript source for Bun and TypeScript-aware bundlers.
27See the repository
28[README](https://github.com/sacenox/cel-tui#readme) and
29[specification](https://github.com/sacenox/cel-tui/blob/main/spec.md) for the
30complete contract.