gleamtea/textinput

A bubble: a single-line text input.

Types

An opaque text-input value.

pub type TextInput

Values

pub fn blur(input: TextInput) -> TextInput

Remove focus.

pub fn clear(input: TextInput) -> TextInput

Empty the input.

pub fn focus(input: TextInput) -> TextInput

Give the input focus (it will accept keystrokes).

pub fn new(
  prompt prompt: String,
  placeholder placeholder: String,
) -> TextInput

A text input with the given prompt and placeholder text.

pub fn update(
  msg: msg,
  input: TextInput,
) -> #(TextInput, gleamtea.Cmd(msg))

Feed a message. Only key messages matter, and only while focused.

pub fn value(input: TextInput) -> String

The current value.

pub fn view(input: TextInput) -> String

Render the prompt, the current text and (when focused) the caret.

Search Document