tview icon indicating copy to clipboard operation
tview copied to clipboard

flex-start in tview

Open anderspitman opened this issue 4 months ago • 1 comments

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.

anderspitman avatar Sep 09 '25 20:09 anderspitman

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.

rivo avatar Sep 28 '25 16:09 rivo