Cursor
An in-line blinking cursor widget — a visible insertion point that isn't tied to the real terminal cursor. Perfect for building text editors, prompts, or any UI that needs its own caret. Choose block, underline or bar.
Install the package
Every component ships in the single dart_tui package.
$dart pub add dart_tui

final cursor = CursorModel(
mode: CursorMode.block, // block █, underline _, or bar |
blink: true, // toggles on every TickMsg
);
// Forward TickMsg to make it blink, then embed in your view:
final rendered = 'hello${cursor.view().content}world'; // → hello█worldCursorModel
| Property | Type | Description |
|---|---|---|
| mode | CursorMode | block, underline or bar. |
| blink | bool | Toggle visibility on each TickMsg. |
| visible | bool | Current on/off state of the blink. |
| focused | bool | When false, the cursor renders steady. |