Spinner Selector
Spin, spin, spin!
Last updated
Spin, spin, spin!
Last updated
Terminaux provides a selector that allows you to choose a spinner in an interactive way with live previews based on the cyclic screen feature. This feature can be found in the SpinnerSelector
class found in the Terminaux.Inputs.Styles
namespace, and you can run it with the following functions:
PromptForSpinner()
PromptForSpinner(string spinner)
The first overload automatically falls back to the Dots
built-in spinner, while the second overload allows you to specify the name of a built-in spinner. You can get a list of built-in spinner names defined in the BuiltinSpinners
class.
You can't use custom spinners, as they are not considered to be built-in.
Once the user end submitted their selection, the two functions will return a Spinner
instance obtained from the built-in spinner instance list, which can be rendered immediately using a function described here.
The below keybindings can be used to control the selector:
Keybinding | Action |
---|---|
| Previous spinner |
| Next spinner |
| Submits your selection |
| Cancels your selection and returns the initial spinner |
| Help page |
| Select a spinner from the list |
| Select a spinner by writing its name |