https://github.com/ahaoboy/r-tui
r-tui (react terminal UI)
https://github.com/ahaoboy/r-tui
js react terminal web
Last synced: about 2 months ago
JSON representation
r-tui (react terminal UI)
- Host: GitHub
- URL: https://github.com/ahaoboy/r-tui
- Owner: ahaoboy
- Created: 2024-07-02T13:42:01.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-03T10:12:41.000Z (over 1 year ago)
- Last Synced: 2025-03-03T02:21:58.517Z (over 1 year ago)
- Topics: js, react, terminal, web
- Language: TypeScript
- Homepage:
- Size: 364 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## r-tui (react terminal UI)
A simplified version of [ink](https://github.com/vadimdemedes/ink)
```tsx
export default function App() {
return (
);
}
```

## api polyfill
For more convenient use, please ensure that the running environment contains at least the following APIs
### input
```
process.stdin.setRawMode
process.stdin.read
process.stdin.addListener("readable", cb)
process.stdin.addListener("data", cb)
process.stdout.rows
process.stdout.columns
```
### output
```
process.stdout.write
```
## example
### [cmd](./ui/src/examples/cmd.tsx)

### [snake](./ui/src/examples/snake.tsx)

### [ls](./ui/src/examples/ls.tsx)

### [life game](./ui/src/examples/life.tsx)

## txiki.js
[r-tui-txiki-react](https://github.com/ahaoboy/r-tui-txiki)
[r-tui-txiki-solidjs](https://github.com/ahaoboy/r-tui-txiki-solidjs)
### perf
| perf | size | time |
| :---: | :---: | :---: |
| react | 123K | 40ms |
| solid | 32K | 40ms |
## todo
- [ ] support yoga-wasm-web api
- [ ] custom event