github charmbracelet/huh v0.2.3

latest releases: v0.6.0, v0.5.3, v0.5.2...
11 months ago

Better Defaults!

Huh? v0.2.3 fixes some bugs for more consistent behaviour across inputs 🐞

  • Text inputs now update values on each keystroke rather than on Blur for consistency.
  • Select and MultiSelect read their default values from the initial values set by the Value variable if provided.

A special thanks to @vitor-mariano for all his contributions to this release 🤗

Defaults Example

You can now have preselected options by declaring them in the Value variable:

var toppings = []string{"Lettuce", "Tomatoes"}
var options = huh.NewOptions("Lettuce", "Tomatoes", "Charm Sauce", "Cheese", "Vegan Cheese")

huh.NewMultiSelect[string]().Title("Toppings").Options(options...).Value(&toppings).Run()

In the above example, Lettuce and Tomatoes will be preselected by default.

What's Changed

Full Changelog: v0.2.2...v0.2.3


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

Don't miss a new huh release

NewReleases is sending notifications on new releases.