# `Alaja.Components.Box`
[🔗](https://github.com/Lorenzo-SF/alaja/blob/2.1.0/lib/alaja/components/box.ex#L1)

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!   │
    # ╰─────────────────╯

## As a wrapper (post-processor)

As of v0.3.0, `render/2` accepts a `String.t()`,
`[String.t()]`, OR an `Alaja.Buffer.t()` as its content. When passed
a Buffer, the box wraps it at the buffer's exact width — this is the
foundation for composing components inside boxes. The result is
always a Buffer (Buffer-in, Buffer-out).

## Cell engine

`render/2` returns an `Alaja.Buffer.t/0`. The width is determined
by the content's width plus padding. If the content is a Buffer,
width is taken from `buffer.width + padding * 2`.

# `content`

```elixir
@type content() :: String.t() | [String.t()] | Alaja.Buffer.t()
```

# `print`

```elixir
@spec print(
  content(),
  keyword()
) :: :ok
```

Prints a box around the given content.

# `render`

```elixir
@spec render(
  content(),
  keyword()
) :: Alaja.Buffer.t()
```

Renders a box around `content` and returns an `Alaja.Buffer.t/0`.

## Options

- `:title` - Optional title in the top border
- `:border` - Border style (default `:rounded`)
- `:border_color` - RGB tuple for border color (default cyan)
- `:width` - Inner content width (default: auto from content)
- `:padding` - Inner horizontal padding (default 1)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
