[GH-ISSUE #113] Feature request: Add a TreeView widget #89

Closed
opened 2026-03-04 01:01:50 +03:00 by kerem · 3 comments
Owner

Originally created by @microo8 on GitHub (May 11, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/113

It would be great to have a list with expandable items that have also lists in them.
Much of real world things can be described with a tree.
Like in the postgres example, you would have something like this:

- databases
   + db1
   - db2
         + extensions
         - schemas
            - public
               - tables
                     > table1
                     > table2
               + views
               + types
               + functions
               + triggers

Every item would be selectable and would toggle the expansion with eg the space key. This would be great to also browse files, check data structures (xml, json), and so on.

Originally created by @microo8 on GitHub (May 11, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/113 It would be great to have a list with expandable items that have also lists in them. Much of real world things can be described with a tree. Like in the postgres example, you would have something like this: ``` - databases + db1 - db2 + extensions - schemas - public - tables > table1 > table2 + views + types + functions + triggers ``` Every item would be selectable and would toggle the expansion with eg the space key. This would be great to also browse files, check data structures (xml, json), and so on.
kerem 2026-03-04 01:01:50 +03:00
Author
Owner

@rivo commented on GitHub (May 12, 2018):

This came up in #109 also (have a look at the package @dastergon mentions) and so far, I'm not sure yet if it should be a standard component of this package. It strikes me as very application dependent - even your layout differs from the layout presented in #109, and the request there was to be able to collapse and expand subtrees, too.

But since there were two requests in such a short time, maybe it should be included. So I'm adding the "on roadmap" label. But I will need some time to think about what this should look like (not just the layout/design but also the API itself).

<!-- gh-comment-id:388541738 --> @rivo commented on GitHub (May 12, 2018): This came up in #109 also (have a look at the package @dastergon mentions) and so far, I'm not sure yet if it should be a standard component of this package. It strikes me as very application dependent - even your layout differs from the layout presented in #109, and the request there was to be able to collapse and expand subtrees, too. But since there were two requests in such a short time, maybe it should be included. So I'm adding the "on roadmap" label. But I will need some time to think about what this should look like (not just the layout/design but also the API itself).
Author
Owner

@AaronOmanLendesk commented on GitHub (Jun 13, 2018):

Count me in for desiring this feature, too. I'm going to take a stab at implementing my own version today. I will follow up on #109 and see if that helps me out.
👍

<!-- gh-comment-id:396996872 --> @AaronOmanLendesk commented on GitHub (Jun 13, 2018): Count me in for desiring this feature, too. I'm going to take a stab at implementing my own version today. I will follow up on #109 and see if that helps me out. :+1:
Author
Owner

@rivo commented on GitHub (Jun 20, 2018):

I'm happy to announce that the TreeView primitive is now part of tview. Please see the documentation for details and the wiki or the presentation in the demos directory for examples.

If you find any bugs, let me know.

<!-- gh-comment-id:398665697 --> @rivo commented on GitHub (Jun 20, 2018): I'm happy to announce that the `TreeView` primitive is now part of `tview`. Please see [the documentation](https://godoc.org/github.com/rivo/tview#TreeView) for details and [the wiki](https://github.com/rivo/tview/wiki/TreeView) or the presentation in the `demos` directory for examples. If you find any bugs, let me know.
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#89
No description provided.