Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example interacting with tabs using lipgloss #181

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

sspaink
Copy link

@sspaink sspaink commented Jan 5, 2022

The lipgloss project has a cool example showing tabs but are static, took me a moment to figure out how to make them interactive so thought maybe someone else would benefit from an example as well. Partially addresses the issue asking for more examples with lipgloss integration: #88 also added a gif example similar to: #158

recording-tabs

@koddr
Copy link

koddr commented Jan 31, 2022

Wow! A great example that gives an excellent idea of how to work with tabs (which the README of the project cannot).
Thank you very much, I hope this gets accepted! ❤️

@sspaink another idea for an example to this project (which is great challenging, I think) is tabs with different list items (from the bubbles library) with different content loaded in each one.

Combining multiple elements (from bubbles and lipgloss) is the part of this great project that is almost always left out of the examples and (some kind of) documentation in README. I think this is why buttletea has such a high entry threshold and such a low number of stars on GitHub (as it could be), compared to other Go TUI frameworks.

@sspaink
Copy link
Author

sspaink commented Jan 31, 2022

Thanks for the kind words! I spent some time working on this project using bubbletea that does use the tabs with different list items: https://github.com/sspaink/telegraf-companion the code can be found here: https://github.com/sspaink/telegraf-companion/blob/main/ui/sampleconfig_ui/plugin_page.go essentially managing a slice of lists.Model is all you need to do. I could update this example to show different list items as well.

@koddr
Copy link

koddr commented Jan 31, 2022

Thanks @sspaink for the answer and the code example.
Although it's hard to understand it apart from the context of your app, but I'll try…

I could update this example to show different list items as well.

That would be just super awesome and kind of magic! 👍
If you have time for this, I would be thrilled with such a basic example with list.

Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meowgorithm
Copy link
Member

meowgorithm commented Feb 3, 2022

Hey, everyone. And, @sspaink, thank you the PR. We’ve been a little backed up this month, but we’ll get to this one.

In terms of the tabs-of-lists example, why don’t we do this:

  1. Keep this example as-is so that people can get a quick understanding of how to work with tabs in Bubble Tea.
  2. Add a separate example (in a separate PR) illustrating how to work with multiple lists in different tabs as suggested above.

@maaslalani
Copy link
Contributor

maaslalani commented Aug 18, 2022

Hey! Thank you for this PR, I cleaned up the example a tiny bit and made it the content also surrounded by a border.

tabexample.mov

@maaslalani maaslalani merged commit 6faba76 into charmbracelet:master Aug 18, 2022
lorenzo-milicia pushed a commit to lorenzo-milicia/bubbles that referenced this pull request Mar 5, 2023
* refactor: remove cursor logic from textinput
* chore: Add Deprecated Fields to avoid breaking changes
* fix: Ctrl+A and typing moves to end bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants