Phil Scott 223642b797
Add blog to docs (#484)
* Adding social card infrastructure
* Upgrades doc project to .NET 6
* Adds Playwright
* Changes the console to a web project for Playwright
* Adds social card template
* Added blog content
* Parallelized social image processing
* Updating CI to use .NET 6 for docs build
2021-07-15 19:53:01 +02:00

969 B

Title: Selection Order: 1 Description: "The SelectionPrompt can be used when you want the user to select a single item from a provided list."

The SelectionPrompt can be used when you want the user to select a single item from a provided list.

Using prompts inside status or progress displays, are not supported.

Usage

// Ask for the user's favorite fruit
var fruit = AnsiConsole.Prompt(
    new SelectionPrompt<string>()
        .Title("What's your [green]favorite fruit[/]?")
        .PageSize(10)
        .MoreChoicesText("[grey](Move up and down to reveal more fruits)[/]")
        .AddChoice("Apple")
        .AddChoices(new[] {
            "Apricot", "Avocado", 
            "Banana", "Blackcurrant", "Blueberry",
            "Cherry", "Cloudberry", "Cocunut",
        }));

// Echo the fruit back to the terminal
AnsiConsole.WriteLine($"I agree. {fruit} is tasty!");