[GH-ISSUE #735] grid border title #540

Closed
opened 2026-03-04 01:05:51 +03:00 by kerem · 1 comment
Owner

Originally created by @xhsky on GitHub (Jun 23, 2022).
Original GitHub issue: https://github.com/rivo/tview/issues/735

Is there a way to add a title to the grid's border?

Originally created by @xhsky on GitHub (Jun 23, 2022). Original GitHub issue: https://github.com/rivo/tview/issues/735 Is there a way to add a title to the grid's border?
kerem closed this issue 2026-03-04 01:05:52 +03:00
Author
Owner

@rivo commented on GitHub (Aug 11, 2022):

You can add a title to any primitive using Box.SetTitle().

If you mean to add a title to each grid item, drawn over the grid lines, there is no direct way. You could remove the gaps and add borders and titles to each of your grid items. But this will draw separate boxes for each item. Not as pretty as the grid lines but it might do the trick for you.

<!-- gh-comment-id:1212417234 --> @rivo commented on GitHub (Aug 11, 2022): You can add a title to any primitive using [`Box.SetTitle()`](https://pkg.go.dev/github.com/rivo/tview#Box.SetTitle). If you mean to add a title to each grid item, drawn over the grid lines, there is no direct way. You could [remove](https://pkg.go.dev/github.com/rivo/tview#Grid.SetBorders) the [gaps](https://pkg.go.dev/github.com/rivo/tview#Grid.SetGap) and add borders and titles to each of your grid items. But this will draw separate boxes for each item. Not as pretty as the grid lines but it might do the trick for you.
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#540
No description provided.