Alaja.Components.Header (Alaja v1.0.0)

Copy Markdown View Source

Static header component for terminal output.

Renders a centered title with optional subtitle and decorative lines. Used by the CLI alaja show commands and for formatted terminal output.

Usage

iex> Alaja.Components.Header.print("My App", subtitle: "v1.0.0")
# Prints a formatted header to stdout

iex> Alaja.Components.Header.render("My App", size: :large)
# Returns iodata (does not print)

Summary

Functions

Prints a header directly to stdout.

Renders a header to iodata without printing.

Types

color()

@type color() :: {0..255, 0..255, 0..255} | nil

size()

@type size() :: :small | :medium | :large

Functions

print(title, opts \\ [])

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

Prints a header directly to stdout.

Options

  • :subtitle - Optional subtitle string
  • :size - :small | :medium | :large (default: :medium)

  • :color - RGB tuple for title color (default: cyan)
  • :subtitle_color - RGB tuple for subtitle color (default: gray)
  • :width - Total width in characters (default: terminal width or 80)

render(title, opts \\ [])

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

Renders a header to iodata without printing.