Alaja.Components.Box (Alaja v1.0.0)

Copy Markdown View Source

Static box/container with borders for terminal output.

Renders a bordered box around content, with optional title.

Usage

iex> Alaja.Components.Box.print("Hello, world!", title: "Greeting")
# ╭─ Greeting ──────╮
# │ Hello, world!   │
# ╰─────────────────╯

Summary

Functions

Prints a box around the given content.

Renders a box to iodata without printing.

Functions

print(content, opts \\ [])

@spec print(
  String.t() | [String.t()],
  keyword()
) :: :ok

Prints a box around the given content.

Options

  • :title - Optional title in the top border
  • :border - Border style: :single | :double | :rounded | :bold | :none (default: :rounded)

  • :border_color - RGB tuple for border color
  • :width - Inner content width (default: auto from content)
  • :padding - Inner horizontal padding (default: 1)

render(content, opts \\ [])

@spec render(
  String.t() | [String.t()],
  keyword()
) :: iodata()

Renders a box to iodata without printing.