Alaja.Components.Header (Alaja v2.0.0)

Copy Markdown View Source

Static header component for terminal output.

Renders a centered title with optional subtitle and decorative lines.

Usage

iex> Alaja.Components.Header.print("My App", subtitle: "v1.0.0")
iex> Alaja.Components.Header.render("My App", size: :large)

Cell engine

As of v0.3.0, render/2 returns an Alaja.Buffer.t/0 (height 3 or 4 depending on subtitle presence).

Summary

Functions

Prints a header directly to stdout.

Renders a header to an Alaja.Buffer.t/0.

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.

render(title, opts \\ [])

@spec render(
  String.t(),
  keyword()
) :: Alaja.Buffer.t()

Renders a header to an Alaja.Buffer.t/0.