shore/ui

Values

pub fn align(
  alignment: style.Align,
  node: @internal Node(msg),
) -> @internal Node(msg)

Sets alignment of all child nodes

pub fn bar(color: style.Color) -> @internal Node(msg)

A row with a background color

pub fn bar2(
  color: style.Color,
  node: @internal Node(msg),
) -> @internal Node(msg)

A row with a background color, containing items

pub fn box(
  children: List(@internal Node(msg)),
  title: option.Option(String),
) -> @internal Node(msg)

A box container element for holding other nodes

pub fn br() -> @internal Node(msg)

An empty line

pub fn button(
  text: String,
  key: key.Key,
  event: msg,
) -> @internal Node(msg)

A button assigned to a key press to execute an event

pub fn col(
  children: List(@internal Node(msg)),
) -> @internal Node(msg)

A container element for holding other nodes over multiple lines

pub fn debug() -> @internal Node(msg)

Prints some positional information for developer debugging

pub fn graph(
  width: style.Size,
  height: style.Size,
  points: List(Float),
) -> @internal Node(msg)

An extremely simple plot

pub fn hr() -> @internal Node(msg)

A horizontal line

pub fn hr_styled(color: style.Color) -> @internal Node(msg)

A colored horizontal line

pub fn input(
  label: String,
  value: String,
  width: style.Size,
  event: fn(String) -> msg,
) -> @internal Node(msg)

A field for text input

pub fn input_hidden(
  label: String,
  value: String,
  width: style.Size,
  event: fn(String) -> msg,
) -> @internal Node(msg)

A field for text input with the content display hidden, useful for password fields

pub fn keybind(key: key.Key, event: msg) -> @internal Node(msg)

A non-visible button assigned to a key press to execute an event

pub fn progress(
  width: style.Size,
  max: Int,
  value: Int,
  color: style.Color,
) -> @internal Node(msg)

A progress bar, will automatically calculate fill percent based off max and current values

pub fn row(
  children: List(@internal Node(msg)),
) -> @internal Node(msg)

A container element for holding other nodes in a single line

pub fn table(
  width: style.Size,
  table: List(List(String)),
) -> @internal Node(msg)

A table layout

pub fn table_kv(
  width: style.Size,
  table: List(List(String)),
) -> @internal Node(msg)

A Key-Value style table layout

pub fn text(text: String) -> @internal Node(msg)

A text string

pub fn text_styled(
  text: String,
  fg: option.Option(style.Color),
  bg: option.Option(style.Color),
) -> @internal Node(msg)

A text string with colored foreground and/or background

Search Document