Spectre.Console.Next
0.2.0
dotnet add package Spectre.Console.Next --version 0.2.0
NuGet\Install-Package Spectre.Console.Next -Version 0.2.0
<PackageReference Include="Spectre.Console.Next" Version="0.2.0" />
paket add Spectre.Console.Next --version 0.2.0
#r "nuget: Spectre.Console.Next, 0.2.0"
// Install Spectre.Console.Next as a Cake Addin #addin nuget:?package=Spectre.Console.Next&version=0.2.0 // Install Spectre.Console.Next as a Cake Tool #tool nuget:?package=Spectre.Console.Next&version=0.2.0
Spectre Console Next
This repository contains some powerful UI for Spectre.Console.
Aware of the natural limitations that comes with Spectre interactivity, I made some tricks for being able to show, for example, our file explorer with a search bar, that's is rebuilding the UI inside a live at every change, this works and makes the UI very powerful.
Usage samples
To prompt user for selecting a file:
var selected = await FileExplorer.Show("baseDirectory", showRange (defaults to 10));
To prevent bugs and other undesirable effects, you should use the async code as is, without running multiple live widgets at the same time (I'm not sure about the effects of this, but some buffer overlaps can occur).
Migrating
The new version uses a new type called InputSource for handling inputs. You can use it almost the same way as before, but need to inject the input source.
You can initialize the input source like this:
var input = new InputSource(AnsiConsole.Console.Input);
input.Run();
And then inject it to the widgets (in this example, the file explorer):
var selected = await FileExplorer.Show(input, "baseDirectory", showRange (defaults to 10));
How to Contribute
Write your widgets, test them manually and make some unit tests for them.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Spectre.Console (>= 0.46.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Spectre.Console.Next:
Package | Downloads |
---|---|
Spectre.Console.Next.Markdown
A extension fo Spectre.Console to also be able to display markdown in terminal |
GitHub repositories
This package is not used by any popular GitHub repositories.
Adding support for a new input source system instead of the directly based on terminal (this should make input interaction between multiple controls at same time possible without blockings).