Skip to main content

Body Column

Overview

A body column is a layout that is used to stack items vertically inside the body. This can be Text, Image or other components. The column can also be a stack of body rows and other body columns.

Body\Layout\BodyColumn::make()

Listing Items

To list items inside the column, use the schema method. The schema method accepts an array of components that will be listed vertically inside the column.

use EightyNine\Reports\Components\Text;

Body\Layout\BodyColumn::make()
->schema([
Text::make("Some title"),
Text::make("Some subtitle"),
Text::make("Some other text"),
]),
alt text

Aligning Items to the center

The column items can be aligned to the center by using the alignCenter method.

use EightyNine\Reports\Components\Text;

Body\Layout\BodyColumn::make()
->alignCenter()
->schema([
Text::make("Some title"),
Text::make("Some subtitle"),
Text::make("Some other text"),
]),
alt text

Aligning Items to the right

The column items can be aligned to the right by using the alignRight method.

use EightyNine\Reports\Components\Text;

Body\Layout\BodyColumn::make()
->alignRight()
->schema([
Text::make("Some title"),
Text::make("Some subtitle"),
Text::make("Some other text"),
]),
alt text

Stacking multiple columns horizontally

The Body Row component can be used to stack multiple columns horizontally. The row component accepts an array of columns that will be stacked horizontally.

use EightyNine\Reports\Components\Text;

Body\Layout\BodyRow::make()
->schema([
Body\Layout\BodyColumn::make()
->schema([
Text::make("Some title"),
Text::make("Some subtitle"),
Text::make("Some other text"),
])->alignLeft(),
Body\Layout\BodyColumn::make()
->schema([
Text::make("Some title"),
Text::make("Some subtitle"),
Text::make("Some other text"),
])->alignRight(),

]),
alt text