[GH-ISSUE #1116] flex-start in tview #810

Closed
opened 2026-03-04 01:07:54 +03:00 by kerem · 2 comments
Owner

Originally created by @anderspitman on GitHub (Sep 9, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1116

Is there a way to accomplish the equivalent of CSS Flexbox flex-start in tview?

I have a single line of text followed by a QR code which spans many lines. I want the QR code to appear right below the text line, but they are both taking up half the available height of the flex container.

Originally created by @anderspitman on GitHub (Sep 9, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1116 Is there a way to accomplish the equivalent of CSS Flexbox flex-start in tview? I have a single line of text followed by a QR code which spans many lines. I want the QR code to appear right below the text line, but they are both taking up half the available height of the flex container.
kerem closed this issue 2026-03-04 01:07:54 +03:00
Author
Owner

@rivo commented on GitHub (Sep 28, 2025):

CSS flex-start is a keyword used in multiple contexts so I'm not sure which one you're referring to. I would even argue that justify-content: flex-start is the default in tview's Flex component.

If you have a TextView with one line of text and another TextView with a QR code, do this:

flex.AddItem(oneLiner, 1, 0, true).
    AddItem(qrCode, 0, 1, false)

This will place the QR code right underneath your one-line text.

<!-- gh-comment-id:3343856322 --> @rivo commented on GitHub (Sep 28, 2025): CSS `flex-start` is a keyword used in multiple contexts so I'm not sure which one you're referring to. I would even argue that `justify-content: flex-start` is the default in `tview`'s `Flex` component. If you have a `TextView` with one line of text and another `TextView` with a QR code, do this: ```go flex.AddItem(oneLiner, 1, 0, true). AddItem(qrCode, 0, 1, false) ``` This will place the QR code right underneath your one-line text.
Author
Owner

@anderspitman commented on GitHub (Jan 20, 2026):

Thanks!

<!-- gh-comment-id:3774356357 --> @anderspitman commented on GitHub (Jan 20, 2026): Thanks!
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#810
No description provided.