Esc.Border (Esc v0.9.0)

View Source

Border styles for terminal boxes.

Summary

Functions

Creates a custom border from a keyword list of characters.

Returns a border style by name.

Lists all available border style names.

Types

t()

@type t() :: %Esc.Border{
  bottom: String.t(),
  bottom_left: String.t(),
  bottom_mid: String.t(),
  bottom_right: String.t(),
  cross: String.t(),
  left: String.t(),
  left_mid: String.t(),
  right: String.t(),
  right_mid: String.t(),
  top: String.t(),
  top_left: String.t(),
  top_mid: String.t(),
  top_right: String.t()
}

Functions

custom(opts)

@spec custom(keyword()) :: t()

Creates a custom border from a keyword list of characters.

Unspecified characters default to the :normal border style.

Options

  • :top - Top edge character
  • :bottom - Bottom edge character
  • :left - Left edge character
  • :right - Right edge character
  • :top_left - Top-left corner character
  • :top_right - Top-right corner character
  • :bottom_left - Bottom-left corner character
  • :bottom_right - Bottom-right corner character

Examples

iex> Border.custom(top: "=", bottom: "=")
%Border{top: "=", bottom: "=", ...}

get(arg1)

@spec get(atom()) :: t() | nil

Returns a border style by name.

Available styles: :normal, :rounded, :thick, :double, :hidden

styles()

@spec styles() :: [atom()]

Lists all available border style names.