New-SpectreLayout
Description
The New-SpectreLayout function creates a new Spectre Layout object with the specified data, columns, or rows. This function is used to create a layout object that can be used to split the console into multiple sections.
You can only have either rows OR columns in a layout and can compose layouts of layouts to create complex layouts.
Examples
Example 1 # This example demonstrates how to create a layout with a calendar, a list of files, and a panel with a calendar aligned to the middle and center.
Parameters
Data
The data to be displayed in the layout.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Object] | false | named | false |
Columns
The columns to be displayed in the layout.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Array] | true | named | false |
Rows
The rows to be displayed in the layout.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Array] | true | named | false |
Ratio
The ratio of the layout, when composing layouts of layouts you can use a higher ratio in one layout to make it larger than the other layouts.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | named | false |
Name
The name of the layout, this is used when you want to access one of the layouts in a nested layout to update the contents.
e.g. in the example below to update the contents of row1 you would use $root = $root["row1"].Update(("hello row 1 again" | Format-SpectrePanel))
Type | Required | Position | PipelineInput |
---|---|---|---|
[String] | false | named | false |
MinimumSize
The minimum size of the layout, this can be used to ensure a layout is at least the minimum width.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | named | false |