View Source BackBreeze.Box (BackBreeze v0.4.1)

A Box is the basic styling primitive used in BackBreeze. If a box has children, they will be rendered first and collapsed down, until a single box remains with the rendered contents.

Summary

Functions

Create a new BackBreeze.Box struct.

Render a box and a tree of its children.

Render a box and a tree of its children whilst tracking dimensions.

Functions

Create a new BackBreeze.Box struct.

Options

  • :style - a style map, with any valid keys from BackBreeze.Style. The :border style can be provided as :line for convenience.

All other options are passed to the BackBreeze.Box struct.

Render a box and a tree of its children.

Options

  • :terminal - the terminal to use. This is used for the terminal size if provided.
Link to this function

render_with_dimensions(box, opts \\ [])

View Source

Render a box and a tree of its children whilst tracking dimensions.

This function returns the box as with render/2, but it is wrapped in a map which also contains the rendered dimension for each box as a flat list. This can be used at a higher level to determine the viewport.

Options

See render/2