bubbles
bubbles copied to clipboard
Select, multi-select and multiline answer components
Also a multiline answer. I would definitely see myself using them on https://github.com/chriswalz/bit.
Right now I'm using https://github.com/AlecAivazis/survey
Agreed, these are desperately needed as a standard bubbles and we're working on it!
Just as a heads up: in the meantime you can already find a custom select example in bubble tea: https://github.com/charmbracelet/bubbletea/blob/master/examples/views/main.go
I already implemented a select-component (not mutli-select though) based on bubbletea over here: https://github.com/erikgeiser/promptkit
It has the following features:
- Pagination
- Filtering
- Custom styling (with color/style support via https://github.com/muesli/termenv)
- Custom choice types
- Proper wrapping for small terminals via https://github.com/muesli/reflow
Currently it is not ready because:
- ~~It depends on my PR in
reflow: https://github.com/muesli/reflow/pull/30 (currently I use a local redirect in thego.mod)~~ merged - ~~I just finished it and didn't test it exhaustively~~ played around for a bit
- ~~I'd like the keyboard shortcuts to be configurable~~ done
- ~~
SliceChoicesonly works with slice of pointers for some reason~~ fixed
If you are interested I can submit this component as a PR to https://github.com/charmbracelet/bubbles and continue to develop it over here.
@muesli what do you think? Do you want a PR or are you working on your own implementation?
Looking good! We love PRs :heart: and I think it makes sense to establish a few default components.
@chriswalz I know this is quite an old issue but we've just introduced a new multi-line input in case you still wanted one 🙂
It's available on master https://github.com/charmbracelet/bubbles and there are some examples on how to use it here https://github.com/charmbracelet/bubbletea/pull/357
Also a multiline answer. I would definitely see myself using them on https://github.com/chriswalz/bit.
Right now I'm using https://github.com/AlecAivazis/survey
Closing since the multi-line input is available with textarea!
And, in terms of mult-select we have an implementation here: https://github.com/charmbracelet/gum/blob/main/choose/choose.go