Vibe.TUI.Widget behaviour (vibe v0.2.2)

Copy Markdown View Source

Behaviour, renderer dispatch, and shared helpers for declarative TUI widgets.

Summary

Types

line()

@type line() :: IO.chardata()

Callbacks

render(t, pos_integer, t)

@callback render(Vibe.TUI.Node.t(), pos_integer(), Vibe.Terminal.Theme.t()) :: [line()]

Functions

background_line(content, width, theme, bg_key, opts \\ [])

@spec background_line(
  IO.chardata(),
  pos_integer(),
  Vibe.Terminal.Theme.t(),
  atom(),
  keyword()
) ::
  line()

block_lines(lines, width, theme, bg_key, opts \\ [])

@spec block_lines(
  [IO.chardata()],
  pos_integer(),
  Vibe.Terminal.Theme.t(),
  atom(),
  keyword()
) :: [
  line()
]

fit_line(line, width)

@spec fit_line(IO.chardata(), pos_integer()) :: line()

fit_line(line, width, opts)

@spec fit_line(IO.chardata(), pos_integer(), keyword()) :: line()

frame_line(content, width, theme)

@spec frame_line(IO.chardata(), pos_integer(), Vibe.Terminal.Theme.t()) :: line()

inset_line(content, width)

@spec inset_line(IO.chardata(), non_neg_integer()) :: line()

join_sides(left, right, width)

@spec join_sides(IO.chardata(), IO.chardata(), pos_integer()) :: line()

pad_line(line, width)

@spec pad_line(IO.chardata(), non_neg_integer()) :: line()

render(node, width, theme \\ Theme.default())

repeat(content, count)

@spec repeat(IO.chardata(), integer()) :: IO.chardata()

spaces(count)

@spec spaces(integer()) :: String.t()

wrap(content, width)

@spec wrap(IO.chardata(), pos_integer()) :: [line()]