charmbracelet / huh

Build terminal forms and prompts 🤷🏻‍♀️
MIT License
3.72k stars 94 forks source link

Adds a new pressable button field #277

Open andrewbenton opened 1 month ago

andrewbenton commented 1 month ago

The button field is styled in a similar to a confirm field with the following differences:

  1. The title is the button's title rather than having a separate title and button label.
  2. When pressed, the button immediately executes the configured action. This is useful for executing actions that make immediate modifications to the form.
  3. When configured to be inline, the description shows up inline after the button.
andrewbenton commented 1 month ago

Here's an example of the new button on asciinema. I couldn't find the utility that runs those .tape scripts.

asciicast