# How to create layout based terminal app in .net core

### Intro:-

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.

### Steps:-

### Create Project:-

`>dotnet new console -o cliapplayout`

### Install Nuget Package:-

`>dotnet add package Spectre.Console`

### Create Object:-

`var layout = new Layout("Root")`

### Split Columns:-

`new Layout("Left")`

### Split Rows:-

`new Layout("Top Layout")`

### Set Ratio and Size:-

`layout["Left"].Ratio(6);` `layout["Right"].Size(42);`

### Set Visibility:-

`layout["Left"].Visible();`

### Render the layout on Console:-   
`AnsiConsole.Write(layout);`
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677845568053/b57ca9e7-e924-4bc5-a604-05fddf327be3.png align="center")      
### Conclusion:-       
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.



