Alaja.Components.Breadcrumbs (Alaja v2.4.0)

Copy Markdown View Source

Static breadcrumb navigation component for terminal output.

Renders a path-like list of items with a separator.

Usage

iex> Alaja.Components.Breadcrumbs.print(["Home", "Projects", "Alaja"])
# Home > Projects > Alaja

Cell engine

As of v0.3.0, render/2 returns an Alaja.Buffer.t/0 (or an empty list when given []). Each item gets its own colour, with the last item rendered in :current_color.

Summary

Functions

Prints breadcrumbs to stdout.

Renders breadcrumbs to an Alaja.Buffer.t/0 (single row, height 1).

Functions

print(items, opts \\ [])

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

Prints breadcrumbs to stdout.

render(items, opts)

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

Renders breadcrumbs to an Alaja.Buffer.t/0 (single row, height 1).

Returns [] for an empty list (legacy compat with the iodata API).