How to create layout based terminal app in .net core
·Mar 3, 2023·
1 min read
Layout class represents a renderable to divide a fixed height into rows or columns.Spectre.Console is a .NET library which is used to create console applications. Spectre.Console is rendering the tree on the terminal.
>dotnet new console -o cliapplayout
Install Nuget Package:-
>dotnet add package Spectre.Console
var layout = new Layout("Root")
new Layout("Top Layout")
Set Ratio and Size:-
Render the layout on Console:-
To create a layout, create object then split the Columns and Rows. Give Ratio and Size according to app requirement. Call Visible(), and Render the layout on Console. The full source code is on GitHub.