Spectre.Console Documentation

Create beautiful, cross-platform console applications with Spectre.Console.

Start Here

Get Spectre.Console running in seconds:

dotnet add package Spectre.Console

Then try this quick example that demonstrates styled text, a table, and a status spinner:

// Styled text with markup
AnsiConsole.MarkupLine("[bold blue]Welcome[/] to [green]Spectre.Console[/]!");
  
// A simple table
var table = new Table()
    .AddColumn("Feature")
    .AddColumn("Description")
    .AddRow("[green]Markup[/]", "Rich text with colors and styles")
    .AddRow("[blue]Tables[/]", "Structured data display")
    .AddRow("[yellow]Progress[/]", "Spinners and progress bars");
AnsiConsole.Write(table);
  
// Status spinner for work
AnsiConsole.Status()
    .Start("Processing...", ctx =>
    {
        Thread.Sleep(2500);
    });
  
AnsiConsole.MarkupLine("[green]Done![/]");

You're application should look something like this:

Screencast of Spectre.Console in action

Explore the Documentation

Whether you're just getting started or looking to master advanced features, we've organized everything to help you find what you need. Start with the tutorials to build a solid foundation, then dive into specific topics as your projects grow.

Tutorials

How-To Guides

Widgets

  • Text Widget - Render styled text with precise control over formatting and overflow
  • Markup Widget - Render styled text using an inline markup syntax
  • Panel Widget - Create bordered boxes around content with customizable headers, padding, and styles
  • TextPath Widget - Display file paths with intelligent truncation and component styling
  • Table Widget - Display tabular data with customizable columns, rows, borders, and styling
  • Tree Widget - Display hierarchical data structures with expandable tree views
  • Columns Widget - Display content side-by-side in columns with automatic width distribution
  • Rule Widget - Create horizontal dividers and section separators with optional titles
  • Grid Widget - Arrange content in rows and columns without visible borders for flexible layouts
  • Rows Widget - Stack multiple renderables vertically with consistent spacing
  • Layout Widget - Create complex multi-section layouts with the flexible Layout widget
  • Padder Widget - Add padding around any renderable content
  • Align Widget - Control horizontal and vertical alignment of content
  • FigletText Widget - Create large ASCII art text banners using FIGlet fonts
  • BarChart Widget - Display data as horizontal bars with labels, values, and colors
  • BreakdownChart Widget - Display proportional data as a colored bar chart with optional legend
  • Calendar Widget - Display monthly calendars with highlighted dates and events
  • JsonText Widget - Render JSON data with syntax highlighting and customizable colors
  • Canvas Widget - Draw pixel-level graphics and patterns in the console
  • CanvasImage Widget - Display image files in the console using pixel-based rendering

Prompts

  • TextPrompt - Prompt users for text input with validation and default values
  • SelectionPrompt - Let users select a single option from a list with keyboard navigation
  • MultiSelectionPrompt - Allow users to select multiple options from a list

Live Rendering

  • Progress Display - Show progress bars and task status for long-running operations
  • Status Display - Show animated status indicators with spinners for ongoing operations
  • Live Display - Update and refresh any renderable content dynamically in real-time

Explanation

Reference

  • Color Reference - A comprehensive reference of color usage in Spectre.Console
  • Markup Reference - Complete reference for Spectre.Console's inline markup syntax including tags, colors, styles, links, and escaping
  • Box Border Reference - A complete reference of all box border styles available in Spectre.Console
  • Text Style Reference - A comprehensive reference of text styles and decoration options in Spectre.Console
  • Capabilities Reference - Complete reference for terminal capabilities, environment variables, and CI detection in Spectre.Console
  • Table Border Reference - A complete reference of all table border styles available in Spectre.Console
  • Spinner Styles Reference - A reference of built-in spinner animations available for the Status and Spinner APIs
  • Tree Guide Reference - A complete reference of all tree guide styles available in Spectre.Console
  • Emoji Reference - A list of all emoji shortcodes supported by Spectre.Console's Markup