Files
kiln-ui/README.md
T
randrews eabeaf1bf8 Extract kiln-ui: standalone game-agnostic ratatui widget toolkit
Widgets (CodeEditor, TextField, Dialog) plus clipboard/text internals,
extracted from the kiln workspace. No game-engine dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 23:42:48 -05:00

35 lines
1.4 KiB
Markdown

# kiln-ui
Reusable, game-agnostic terminal UI widgets built on [ratatui](https://ratatui.rs).
Extracted from the [kiln](https://github.com/) project so the same widgets can drive
any ratatui front-end (a game editor, a text editor, …). The crate has **no game-engine
dependency**.
## Widgets
- **`code_editor::CodeEditor`** — a hand-written, modeless, keyboard-only full-screen
code editor: selection, undo/redo, word/paragraph motion, system clipboard, and
syntect syntax highlighting. (Highlighting is currently hardcoded to Rhai; a pluggable
syntax/theme is a planned follow-up.)
- **`text_field::TextField`** — a single-line editable field (the building block for
dialog inputs).
- **`dialog::Dialog<Ctx>`** — modal text-entry and filterable-list dialogs, generic over
a host context they mutate only through callbacks.
- **`CursorOverlay` / `render_overlay` / `dim_area`** — the modal-overlay scaffolding:
a widget paints into a buffer and returns where the caret goes; the host places it.
## Notes
- **Not WASM-compatible**: pulls in `syntect` (highlighting) and `arboard` (system
clipboard). The ratatui core itself is WASM-friendly.
- **ratatui version**: pinned to `0.30.x`. Consumers exchange ratatui types with these
widgets, so their `ratatui` must unify with this crate's.
## Development
```bash
cargo build
cargo test # pure-logic unit tests, no TTY required
```