Skip to main content

Layout - HeaderBuilder

Layout.HeaderBuilder

Define a UI Header container from one or more

Stream's within a LayoutBuilder.

Example

  // use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);

// a stream containing a number
const number = Stream("My Number Stream", FloatType)

// a stream containing a string
const string = Stream("My String Stream", StringType)

// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
)
.header(builder => builder
.value("A percentage", number, (value) => StringJoin`${value}%`)
.value("A string", string)

)
.toTemplate()