FlexBox

class tanmatsu.widgets.FlexBox(*args, flex_direction: int = 1, **kwargs)

Bases: Container, Box, Scrollable

A widget that contains other widgets. Has similar behaviour to flexbox from CSS.

Parameters

flex_direction (int) – Must be either VERTICAL or HORIZONTAL. Defaults to VERTICAL.

VERTICAL = 1

Flex from top to bottom. Equivalent to flex-direction: column in CSS.

HORIZONTAL = 2

Flex from left to right. Equivalent to flex-direction: row in CSS.

property flex_direction: int
Getter

Returns the flex direction.

Setter

Sets the flex direction. Must equal either VERTICAL or HORIZONTAL.