gleamtea/textarea

A bubble: a multi-line text area.

Types

An opaque text-area value.

pub type TextArea

Values

pub fn blur(area: TextArea) -> TextArea

Remove focus.

pub fn cursor(area: TextArea) -> #(Int, Int)

The caret position as #(row, col) (both 0-based).

pub fn focus(area: TextArea) -> TextArea

Give the area focus.

pub fn new(
  height height: Int,
  placeholder placeholder: String,
) -> TextArea

A text area showing height visible rows, with placeholder text.

pub fn update(
  msg: msg,
  area: TextArea,
) -> #(TextArea, gleamtea.Cmd(msg))

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

pub fn value(area: TextArea) -> String

The full contents (lines joined with \n).

pub fn view(area: TextArea) -> String

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

Search Document