beamtea_textarea (beamtea v0.1.2)

View Source

A bubble: a multi-line text area, mirroring the textarea package in charmbracelet/bubbles.

Full multi-line editing: insertion, newlines, backspace/delete across line boundaries, and caret movement with the arrows and Home/End. The visible window scrolls vertically to keep the caret in view. As with beamtea_textinput, the caret is drawn with reverse video.

Summary

Functions

Equivalent to new(#{}).

Options: height (visible rows, default 6), placeholder, color, and value (initial contents).

Edit in response to a key (only while focused).

The full contents as a UTF-8 binary (lines joined with \n).

Render the visible lines with the caret (or a faint placeholder).

Types

model/0

-opaque model()

Functions

blur(M)

-spec blur(model()) -> model().

clear(M)

-spec clear(model()) -> model().

cursor(_)

-spec cursor(model()) -> {non_neg_integer(), non_neg_integer()}.

focus(M)

-spec focus(model()) -> model().

focused(_)

-spec focused(model()) -> boolean().

line_count(_)

-spec line_count(model()) -> pos_integer().

new()

-spec new() -> model().

Equivalent to new(#{}).

new(Opts)

-spec new(map()) -> model().

Options: height (visible rows, default 6), placeholder, color, and value (initial contents).

set_value(Value, M)

-spec set_value(iodata(), model()) -> model().

update(Msg, M)

-spec update(term(), model()) -> {model(), beamtea:cmd()}.

Edit in response to a key (only while focused).

value(_)

-spec value(model()) -> binary().

The full contents as a UTF-8 binary (lines joined with \n).

view(M)

-spec view(model()) -> iodata().

Render the visible lines with the caret (or a faint placeholder).