Viewport
A scrollable content pane with optional soft-wrapping — ideal for long text, logs or file content. Also powers the one-shot pager() helper.
Install the package
Every component ships in the single dart_tui package.
$dart pub add dart_tui

ViewportModel(
content: longText,
width: 80,
height: 20,
softWrap: true,
);ViewportModel
| Property | Type | Description |
|---|---|---|
| content | String | Text to display. |
| width | int | Viewport width in columns. Defaults to 80. |
| height | int | Viewport height in rows. Defaults to 24. |
| yOffset / xOffset | int | Current scroll position. |
| softWrap | bool | Wrap long lines to the viewport width. |
Keybindings
↑ / ↓, k / jScroll line
pgup / pgdnScroll page