Earn More by Sharing What You Love
Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!

Tim Corey
7m 51s
Spectre.Console is a NuGet package that enables .NET developers to create visually rich console applications. In his Spectre Console Series, Tim Corey shows how to use features like interactive prompts, tables, progress displays, and more to transform a plain console window into something much more professional.
In this article, we'll take a deeper look at the Spectre Console Panel feature by walking through Tim Corey's video "Content Panels and Callouts - Spectre Console Series." Using Tim's examples, we'll see how to create panels, explore their features, and display data in different styles - all within the available space of the console.
Tim begins the video (0:00) by reminding us that Spectre.Console allows you to turn your C# console apps into visually appealing, informative applications. In this lesson (0:15), we are going to create panels, which can act as simple callouts or even mini tables depending on your need.
At 0:34, Tim writes an example right in Visual Studio. He shows how to create a new instance of a panel:
var panel = new("Tim Corey");
AnsiConsole.Write(panel);Dim panel = New Panel("Tim Corey")
AnsiConsole.Write(panel)He notes (0:47) that AnsiConsole.Write() accepts a renderable object - and since a Panel implements IRenderable, it fits right in. Running the code at 1:02 displays a simple box around the text "Tim Corey." Even this little space can be useful to call out a note, highlight a prompt, or separate user input from other console output.

Tim then moves on to demonstrate panel features. At 1:22 he tweaks the border style:
panel.Border = BoxBorder.Rounded;panel.Border = BoxBorder.RoundedThis gives the panel a rounded border - one of the different styles available. He notes that you could also choose double border or other options to match your custom color-coded themes or blue and green accents.
At 1:42 Tim adjusts the padding inside the panel:
panel.Padding = new(2, 0);panel.Padding = New Padding(2, 0)He explains (2:16) that padding in the console isn't like pixels on the web - it's based on character width and line returns. A big number like 5 creates a large panel that fills a lot of the available area. He counts out the space to demonstrate how padding works (2:35).
This ability to fine-tune the space around content enables you to design panels that match your layout, whether you're showing a var table, a bar chart, or any other data.
At 3:37 Tim adds a header to the panel:
panel.Header("My Name");panel.Header("My Name")When he runs the code at 3:51, the title appears in the border. But it's right up against the content. He fixes this (4:04) by changing the padding:
panel.Padding = new (1, 0);panel.Padding = New Padding(1, 0)This creates a little space between the header and the text. Tim points out (4:16) that using headers and spacing lets you label your panels clearly - useful when you're showing progress of a task, a live display, or even a long-running task with a display progress bar.
Tim then demonstrates how to put a list of strings into a panel. At 4:26 he brings in a list of names from a previous lesson and shows how to join it into a single string:
string panelInfo = string.Join('\n', names);
var panel = new Panel(panelInfo)
.Header("Default Names");Dim panelInfo As String = String.Join(vbLf, names)
Dim panel = New Panel(panelInfo) _
.Header("Default Names")This collapses the list into one string with line breaks (5:02). Running it (5:28) displays the list neatly inside the panel, each item on its own line. This technique lets you present data or object properties in a strongly typed way but rendered as text.

Tim also highlights (5:44) that you can use rich text markup to add custom color to specific items. For example:
"[red]Bilbo Baggins[/]""[red]Bilbo Baggins[/]"This shows how a Spectre Console Panel can handle not just plain strings but also styled content, enabling themes, bold text, or color-coded items.

At 6:19 Tim answers the question of how to center content. A plain string won't center. Instead, you must use a renderable object. He demonstrates (6:34):
Panel panel = new(new Markup(panelInfo).Centered());Dim panel As New Panel(New Markup(panelInfo).Centered())This converts the string into a Markup, calls .Centered(), and assigns it to the panel. Running the code (7:01) shows all names centered. This is especially useful if you're creating a new table, a new bar chart, or any interactive controls and you want the content aligned horizontally in the available space.

Tim also notes (7:07) that panels are IRenderable, so you can nest them inside tables or other panels. This makes it possible to build composite displays: for example, a panel containing a prompt, a var table, and a bar chart side by side, or using panels to show file progress for different tasks.
As Tim wraps up (7:14), he reiterates that panels are IRenderable, which means you can insert them wherever Spectre.Console expects a renderable object - inside tables, inside live displays, or in other layouts. This flexibility enables you to combine panels with other Spectre.Console components like interactive prompts, display progress bars, and custom color-coded themes to create polished .NET console applications.
By following Tim Corey's video, you can confidently start using Spectre.Console panels to create polished, data-rich console experiences with headers, custom themes, and neatly formatted output - all without leaving the console world.
Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!
Join our newsletter, you’ll get exclusive access on article updates. We value your privacy