Skip to main content

Header Column

Overview

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

Header\Layout\HeaderColumn::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;

Header\Layout\HeaderColumn::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;

Header\Layout\HeaderColumn::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;

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

Stacking multiple columns horizontally

The Header 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;

Header\Layout\HeaderRow::make()
->schema([
Header\Layout\HeaderColumn::make()
->schema([
Text::make("Some title"),
Text::make("Some subtitle"),
Text::make("Some other text"),
])->alignLeft(),
Header\Layout\HeaderColumn::make()
->schema([
Text::make("Some title"),
Text::make("Some subtitle"),
Text::make("Some other text"),
])->alignRight(),

]),
alt text