[GH-ISSUE #536] tabs in panels? #389

Open
opened 2026-03-04 01:04:34 +03:00 by kerem · 3 comments
Owner

Originally created by @buzzdan on GitHub (Nov 30, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/536

is it possible to have tabs inside panels like in lazygit ?

image

Originally created by @buzzdan on GitHub (Nov 30, 2020). Original GitHub issue: https://github.com/rivo/tview/issues/536 is it possible to have tabs inside panels like in `lazygit` ? ![image](https://user-images.githubusercontent.com/18007791/100584789-3efbd580-32f5-11eb-914d-55bbdeb90fd3.png)
Author
Owner

@rivo commented on GitHub (Dec 4, 2020):

Currently not without writing your own functionality that does this. If you want to do that, you can check out https://github.com/rivo/tview/wiki/Primitives.

If you look at the presentation demo code, there's something similar in there, with a TextView for the "tabs" and a Pages primitive for the content. The code is here. It's conceivabe to wrap this functionality in its own class so you can have multiple such elements on a page.

Let me know if this helps.

<!-- gh-comment-id:738849021 --> @rivo commented on GitHub (Dec 4, 2020): Currently not without writing your own functionality that does this. If you want to do that, you can check out https://github.com/rivo/tview/wiki/Primitives. If you look at the [presentation demo code](https://github.com/rivo/tview/tree/master/demos/presentation), there's something similar in there, with a `TextView` for the "tabs" and a `Pages` primitive for the content. The code is [here](https://github.com/rivo/tview/blob/master/demos/presentation/main.go). It's conceivabe to wrap this functionality in its own class so you can have multiple such elements on a page. Let me know if this helps.
Author
Owner

@tslocum commented on GitHub (Dec 4, 2020):

TabbedPanels is an example of extracting this functionality to a new class. Let me know if you'd like a PR.

<!-- gh-comment-id:738974941 --> @tslocum commented on GitHub (Dec 4, 2020): [TabbedPanels](https://gitlab.com/tslocum/cview/-/blob/master/tabbedpanels.go) is an example of extracting this functionality to a new class. Let me know if you'd like a PR.
Author
Owner

@buzzdan commented on GitHub (Dec 17, 2020):

thank you guys for the comments 🙏
i will need to implement it soon
@tslocum cview looks pretty neat! i'll check it out !

<!-- gh-comment-id:747458466 --> @buzzdan commented on GitHub (Dec 17, 2020): thank you guys for the comments :pray: i will need to implement it soon @tslocum cview looks pretty neat! i'll check it out !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#389
No description provided.