# Installation

```toml
[dependencies]
tui-pages = "0.7.0"
crossterm = "0.28"
```

Why these two extra crates:

- **`crossterm`** — `tui-pages` doesn't read the keyboard for you. In your event
  loop *you* read a key with crossterm and pass it to `tui.handle_key(key, …)`,
  whose parameter is a `crossterm::event::KeyEvent`. So crossterm has to be your
  own dependency — that's the type the two of you exchange. No conversion needed.
- **a renderer** — the core crate ships no drawing code and doesn't depend on
  `ratatui`; *you* draw the screen. `ratatui` is the obvious pick (and all the
  examples use it), but nothing forces it. Only the optional `dialog` feature
  pulls `ratatui` in.

## Features

### `dialog`

A built-in modal dialog with a ratatui renderer. Pulls in `ratatui 0.28`.

```toml
tui-pages = { version = "0.7", features = ["dialog"] }
```

Gives you `DialogData`, `DialogResult`, `DialogTheme`, `render_dialog`, and the
`dialog::*` helpers that drive a modal for you. See [Dialogs](./dialogs.md).

### `serde`

Derives `Serialize`/`Deserialize` on the input/mode types (`ModeId`, `KeyChord`,
`FocusWrap`), so you can load keybindings from a config file.

```toml
tui-pages = { version = "0.7", features = ["serde"] }
```

## Edition

The crate is built on Rust edition 2021.
