Skip to content

API Reference

Tree

waxy.TaffyTree

TaffyTree()

A tree of layout nodes.

with_capacity staticmethod

with_capacity(capacity: int) -> TaffyTree[NodeContext]

Create a new layout tree with pre-allocated capacity.

new_leaf

new_leaf(style: Style) -> NodeId

Create a new leaf node with the given style.

new_leaf_with_context

new_leaf_with_context(
    style: Style, context: NodeContext
) -> NodeId

Create a new leaf node with the given style and context.

get_node_context

get_node_context(node: NodeId) -> NodeContext | None

Get the context attached to a node, if any.

set_node_context

set_node_context(
    node: NodeId, context: NodeContext | None
) -> None

Set or clear the context attached to a node.

new_with_children

new_with_children(
    style: Style, children: list[NodeId]
) -> NodeId

Create a new node with children.

add_child

add_child(parent: NodeId, child: NodeId) -> None

Add a child to a parent node.

insert_child_at_index

insert_child_at_index(
    parent: NodeId, child_index: int, child: NodeId
) -> None

Insert a child at a specific index.

set_children

set_children(
    parent: NodeId, children: list[NodeId]
) -> None

Set the children of a node, replacing any existing children.

remove_child

remove_child(parent: NodeId, child: NodeId) -> NodeId

Remove a specific child from a parent.

remove_child_at_index

remove_child_at_index(
    parent: NodeId, child_index: int
) -> NodeId

Remove a child at a specific index.

replace_child_at_index

replace_child_at_index(
    parent: NodeId, child_index: int, new_child: NodeId
) -> NodeId

Replace the child at a specific index with a new child.

child_at_index

child_at_index(parent: NodeId, child_index: int) -> NodeId

Get the child at a specific index.

children

children(parent: NodeId) -> list[NodeId]

Get all children of a node.

child_count

child_count(parent: NodeId) -> int

Get the number of children of a node.

parent

parent(child: NodeId) -> NodeId | None

Get the parent of a node, if any.

total_node_count

total_node_count() -> int

Get the total number of nodes in the tree.

remove

remove(node: NodeId) -> NodeId

Remove a node from the tree.

clear

clear() -> None

Clear all nodes from the tree.

set_style

set_style(node: NodeId, style: Style) -> None

Set the style of a node.

style

style(node: NodeId) -> Style

Get the style of a node.

mark_dirty

mark_dirty(node: NodeId) -> None

Mark a node as dirty (needing re-layout).

dirty

dirty(node: NodeId) -> bool

Check if a node is dirty (needs re-layout).

compute_layout

compute_layout(
    node: NodeId,
    available: AvailableSize | None = None,
    measure: Callable[
        [KnownSize, AvailableSize, NodeContext], Size
    ]
    | None = None,
) -> None

Compute the layout of a tree rooted at the given node.

layout

layout(node: NodeId) -> Layout

Get the computed layout of a node.

unrounded_layout

unrounded_layout(node: NodeId) -> Layout

Get the unrounded layout of a node.

enable_rounding

enable_rounding() -> None

Enable rounding of layout values.

disable_rounding

disable_rounding() -> None

Disable rounding of layout values.

print_tree

print_tree(root: NodeId) -> None

Print the layout tree for debugging.

Style

waxy.Style

Style(
    *,
    display: Display | None = None,
    box_sizing: BoxSizing | None = None,
    overflow_x: Overflow | None = None,
    overflow_y: Overflow | None = None,
    scrollbar_width: float | None = None,
    position: Position | None = None,
    inset_left: DimensionValue | None = None,
    inset_right: DimensionValue | None = None,
    inset_top: DimensionValue | None = None,
    inset_bottom: DimensionValue | None = None,
    size_width: DimensionValue | None = None,
    size_height: DimensionValue | None = None,
    min_size_width: DimensionValue | None = None,
    min_size_height: DimensionValue | None = None,
    max_size_width: DimensionValue | None = None,
    max_size_height: DimensionValue | None = None,
    aspect_ratio: float | None = None,
    margin_left: DimensionValue | None = None,
    margin_right: DimensionValue | None = None,
    margin_top: DimensionValue | None = None,
    margin_bottom: DimensionValue | None = None,
    padding_left: LengthPercentageValue | None = None,
    padding_right: LengthPercentageValue | None = None,
    padding_top: LengthPercentageValue | None = None,
    padding_bottom: LengthPercentageValue | None = None,
    border_left: LengthPercentageValue | None = None,
    border_right: LengthPercentageValue | None = None,
    border_top: LengthPercentageValue | None = None,
    border_bottom: LengthPercentageValue | None = None,
    align_items: AlignItems | None = None,
    align_self: AlignItems | None = None,
    justify_items: AlignItems | None = None,
    justify_self: AlignItems | None = None,
    align_content: AlignContent | None = None,
    justify_content: AlignContent | None = None,
    gap_width: LengthPercentageValue | None = None,
    gap_height: LengthPercentageValue | None = None,
    text_align: TextAlign | None = None,
    flex_direction: FlexDirection | None = None,
    flex_wrap: FlexWrap | None = None,
    flex_basis: DimensionValue | None = None,
    flex_grow: float | None = None,
    flex_shrink: float | None = None,
    grid_template_rows: list[GridTrackValue] | None = None,
    grid_template_columns: list[GridTrackValue]
    | None = None,
    grid_auto_rows: list[GridTrackValue] | None = None,
    grid_auto_columns: list[GridTrackValue] | None = None,
    grid_auto_flow: GridAutoFlow | None = None,
    grid_row: GridPlacement | None = None,
    grid_column: GridPlacement | None = None,
)

Style properties for a layout node.

All fields are keyword-only. Passing None (or omitting) uses the taffy default. Style is immutable — construct a new instance to change fields, or use | to merge.

See: taffy Style

All arguments are keyword-only. Omitting or passing None for a field uses the taffy default value for that field. See each property for documentation of individual fields.

Parameters:

Name Type Description Default
display Display | None

How the node is laid out (Block, Flex, Grid, or Nil). MDN

None
box_sizing BoxSizing | None

Whether size includes border and padding (BorderBox) or not (ContentBox). MDN

None
overflow_x Overflow | None

How overflowing content is handled horizontally. MDN

None
overflow_y Overflow | None

How overflowing content is handled vertically. MDN

None
scrollbar_width float | None

Width of the scrollbar gutter in pixels. MDN

None
position Position | None

Whether the node is positioned relative to its parent or absolutely. MDN

None
inset_left DimensionValue | None

Left offset for absolutely-positioned nodes. MDN

None
inset_right DimensionValue | None

Right offset for absolutely-positioned nodes. MDN

None
inset_top DimensionValue | None

Top offset for absolutely-positioned nodes. MDN

None
inset_bottom DimensionValue | None

Bottom offset for absolutely-positioned nodes. MDN

None
size_width DimensionValue | None

Preferred width of the node. MDN

None
size_height DimensionValue | None

Preferred height of the node. MDN

None
min_size_width DimensionValue | None

Minimum width of the node. MDN

None
min_size_height DimensionValue | None

Minimum height of the node. MDN

None
max_size_width DimensionValue | None

Maximum width of the node. MDN

None
max_size_height DimensionValue | None

Maximum height of the node. MDN

None
aspect_ratio float | None

Preferred aspect ratio (width / height), or None. MDN

None
margin_left DimensionValue | None

Left outer spacing. MDN

None
margin_right DimensionValue | None

Right outer spacing. MDN

None
margin_top DimensionValue | None

Top outer spacing. MDN

None
margin_bottom DimensionValue | None

Bottom outer spacing. MDN

None
padding_left LengthPercentageValue | None

Left inner spacing. MDN

None
padding_right LengthPercentageValue | None

Right inner spacing. MDN

None
padding_top LengthPercentageValue | None

Top inner spacing. MDN

None
padding_bottom LengthPercentageValue | None

Bottom inner spacing. MDN

None
border_left LengthPercentageValue | None

Left border width. MDN

None
border_right LengthPercentageValue | None

Right border width. MDN

None
border_top LengthPercentageValue | None

Top border width. MDN

None
border_bottom LengthPercentageValue | None

Bottom border width. MDN

None
align_items AlignItems | None

Default alignment of children along the cross axis. MDN

None
align_self AlignItems | None

Override alignment of this node along the parent's cross axis. MDN

None
justify_items AlignItems | None

Default alignment of children along the main axis. MDN

None
justify_self AlignItems | None

Override alignment of this node along the parent's main axis. MDN

None
align_content AlignContent | None

Alignment of rows/columns when there is extra space in the cross axis. MDN

None
justify_content AlignContent | None

Distribution of children along the main axis. MDN

None
gap_width LengthPercentageValue | None

Horizontal gap between grid/flex items. MDN

None
gap_height LengthPercentageValue | None

Vertical gap between grid/flex items. MDN

None
text_align TextAlign | None

Text alignment within the node. MDN

None
flex_direction FlexDirection | None

Direction of the flex container's main axis. MDN

None
flex_wrap FlexWrap | None

Whether flex items wrap onto multiple lines. MDN

None
flex_basis DimensionValue | None

Default size of a flex item before growing or shrinking. MDN

None
flex_grow float | None

Rate at which a flex item grows to fill available space. MDN

None
flex_shrink float | None

Rate at which a flex item shrinks when space is tight. MDN

None
grid_template_rows list[GridTrackValue] | None

Explicit row track sizing in a grid container. MDN

None
grid_template_columns list[GridTrackValue] | None

Explicit column track sizing in a grid container. MDN

None
grid_auto_rows list[GridTrackValue] | None

Sizing of implicitly-created row tracks. MDN

None
grid_auto_columns list[GridTrackValue] | None

Sizing of implicitly-created column tracks. MDN

None
grid_auto_flow GridAutoFlow | None

How auto-placed items are inserted in the grid. MDN

None
grid_row GridPlacement | None

Row placement of this item in a grid container. MDN

None
grid_column GridPlacement | None

Column placement of this item in a grid container. MDN

None

display property

display: Display

How the node is laid out (Block, Flex, Grid, or Nil). MDN.

box_sizing property

box_sizing: BoxSizing

Whether size includes border and padding (BorderBox) or not (ContentBox). MDN.

overflow_x property

overflow_x: Overflow

How overflowing content is handled horizontally. MDN.

overflow_y property

overflow_y: Overflow

How overflowing content is handled vertically. MDN.

scrollbar_width property

scrollbar_width: float

Width of the scrollbar gutter in pixels. MDN.

position property

position: Position

Whether the node is positioned relative to its parent or absolutely. MDN.

inset_left property

inset_left: DimensionValue

Left offset for absolutely-positioned nodes. MDN.

inset_right property

inset_right: DimensionValue

Right offset for absolutely-positioned nodes. MDN.

inset_top property

inset_top: DimensionValue

Top offset for absolutely-positioned nodes. MDN.

inset_bottom property

inset_bottom: DimensionValue

Bottom offset for absolutely-positioned nodes. MDN.

size_width property

size_width: DimensionValue

Preferred width of the node. MDN.

size_height property

size_height: DimensionValue

Preferred height of the node. MDN.

min_size_width property

min_size_width: DimensionValue

Minimum width of the node. MDN.

min_size_height property

min_size_height: DimensionValue

Minimum height of the node. MDN.

max_size_width property

max_size_width: DimensionValue

Maximum width of the node. MDN.

max_size_height property

max_size_height: DimensionValue

Maximum height of the node. MDN.

aspect_ratio property

aspect_ratio: float | None

Preferred aspect ratio (width / height), or None. MDN.

margin_left property

margin_left: DimensionValue

Left outer spacing. MDN.

margin_right property

margin_right: DimensionValue

Right outer spacing. MDN.

margin_top property

margin_top: DimensionValue

Top outer spacing. MDN.

margin_bottom property

margin_bottom: DimensionValue

Bottom outer spacing. MDN.

padding_left property

padding_left: LengthPercentageValue

Left inner spacing. MDN.

padding_right property

padding_right: LengthPercentageValue

Right inner spacing. MDN.

padding_top property

padding_top: LengthPercentageValue

Top inner spacing. MDN.

padding_bottom property

padding_bottom: LengthPercentageValue

Bottom inner spacing. MDN.

border_left property

border_left: LengthPercentageValue

Left border width. MDN.

border_right property

border_right: LengthPercentageValue

Right border width. MDN.

border_top property

Top border width. MDN.

border_bottom property

border_bottom: LengthPercentageValue

Bottom border width. MDN.

align_items property

align_items: AlignItems | None

Default alignment of children along the cross axis. MDN.

align_self property

align_self: AlignItems | None

Override alignment of this node along the parent's cross axis. MDN.

justify_items property

justify_items: AlignItems | None

Default alignment of children along the main axis. MDN.

justify_self property

justify_self: AlignItems | None

Override alignment of this node along the parent's main axis. MDN.

align_content property

align_content: AlignContent | None

Alignment of rows/columns when there is extra space in the cross axis. MDN.

justify_content property

justify_content: AlignContent | None

Distribution of children along the main axis. MDN.

gap_width property

Horizontal gap between grid/flex items. MDN.

gap_height property

Vertical gap between grid/flex items. MDN.

text_align property

text_align: TextAlign

Text alignment within the node. MDN.

flex_direction property

flex_direction: FlexDirection

Direction of the flex container's main axis. MDN.

flex_wrap property

flex_wrap: FlexWrap

Whether flex items wrap onto multiple lines. MDN.

flex_basis property

flex_basis: DimensionValue

Default size of a flex item before growing or shrinking. MDN.

flex_grow property

flex_grow: float

Rate at which a flex item grows to fill available space. MDN.

flex_shrink property

flex_shrink: float

Rate at which a flex item shrinks when space is tight. MDN.

grid_template_rows property

grid_template_rows: list[GridTrackValue]

Explicit row track sizing in a grid container. MDN.

grid_template_columns property

grid_template_columns: list[GridTrackValue]

Explicit column track sizing in a grid container. MDN.

grid_auto_rows property

grid_auto_rows: list[GridTrackValue]

Sizing of implicitly-created row tracks. MDN.

grid_auto_columns property

grid_auto_columns: list[GridTrackValue]

Sizing of implicitly-created column tracks. MDN.

grid_auto_flow property

grid_auto_flow: GridAutoFlow

How auto-placed items are inserted in the grid. MDN.

grid_row property

grid_row: GridPlacement

Row placement of this item in a grid container. MDN.

grid_column property

grid_column: GridPlacement

Column placement of this item in a grid container. MDN.

Layout

waxy.Layout

The computed layout of a node.

The layout uses a border box coordinate system:

  • location is the position of this node's border box origin, relative to the parent's border box origin (not the parent's content box, and not absolute/viewport coordinates). This means a child inside a parent with padding or border will have its location offset by the parent's padding + border widths. A child's own margin also offsets its location outward from siblings.
  • size is the border box size: it includes border + padding + content, but excludes margin.
  • To compute absolute positions, accumulate location values from the root down to the node.
  • To compute the content box, subtract border and padding from size (or use content_box_width() / content_box_height()).
  • To compute the margin box, expand outward from (location, size) by the margin widths.

Note: box_sizing does not affect the Layout output. It only controls how the style's size_width/size_height inputs are interpreted (as border box or content box dimensions). The computed Layout.size is always the border box. For example, with padding_left=10, padding_right=10 and size_width=100:

  • BorderBox (default): style size is the border box → layout.size.width = 100, content_box_width() = 80
  • ContentBox: style size is the content box → layout.size.width = 120, content_box_width() = 100

order property

order: int

Topological paint order computed by taffy. Higher values are painted on top.

location property

location: Point

Position of this node's border box origin, relative to the parent's border box origin.

size property

size: Size

Border box dimensions (includes border + padding + content, excludes margin).

content_size property

content_size: Size

Size of the content inside the node (may exceed the border box if overflowing).

scrollbar_size property

scrollbar_size: Size

Size reserved for scrollbars.

border property

border: Rect

Resolved border widths on each side.

padding property

padding: Rect

Resolved padding widths on each side.

margin property

margin: Rect

Resolved margin widths on each side.

content_box_width

content_box_width() -> float

Width of the content box (size minus padding and border).

content_box_height

content_box_height() -> float

Height of the content box (size minus padding and border).

Node

waxy.NodeId

A handle to a node in the layout tree.

Geometry

waxy.Size

Size(width: float = 0.0, height: float = 0.0)

A 2D size with width and height.

area property

area: float

The area (width * height).

waxy.Rect

Rect(
    left: float = 0.0,
    right: float = 0.0,
    top: float = 0.0,
    bottom: float = 0.0,
)

A rectangle with left, right, top, bottom edges.

width property

width: float

The width of the rectangle (right - left).

height property

height: float

The height of the rectangle (bottom - top).

size property

size: Size

The size of the rectangle as a Size.

top_left property

top_left: Point

The top-left corner point.

top_right property

top_right: Point

The top-right corner point.

bottom_right property

bottom_right: Point

The bottom-right corner point.

bottom_left property

bottom_left: Point

The bottom-left corner point.

contains

contains(point: Point) -> bool

Check if a point is inside this rectangle.

corners

corners() -> tuple[Point, Point, Point, Point]

Return the four corner points (top-left, top-right, bottom-right, bottom-left).

top_edge

top_edge() -> Iterator[Point]

Iterate over integer pixel locations along the top edge.

bottom_edge

bottom_edge() -> Iterator[Point]

Iterate over integer pixel locations along the bottom edge.

left_edge

left_edge() -> Iterator[Point]

Iterate over integer pixel locations along the left edge.

right_edge

right_edge() -> Iterator[Point]

Iterate over integer pixel locations along the right edge.

points

points() -> Iterator[Point]

Iterate over all integer pixel locations contained within this rectangle.

rows

rows() -> Iterator[Iterator[Point]]

Iterate over rows of integer pixel locations.

Each row is an iterator of Points with the same y coordinate.

columns

columns() -> Iterator[Iterator[Point]]

Iterate over columns of integer pixel locations.

Each column is an iterator of Points with the same x coordinate.

waxy.Point

Point(x: float = 0.0, y: float = 0.0)

A 2D point with x and y coordinates.

waxy.Line

Line(start: float = 0.0, end: float = 0.0)

A line segment with start and end values.

length property

length: float

The length of the line segment (end - start).

contains

contains(value: float) -> bool

Check if a value is contained within this line segment.

waxy.KnownSize

KnownSize(
    width: float | None = None, height: float | None = None
)

Known dimensions passed to measure functions (independently-optional width/height).

Passed to the measure callback to indicate which dimensions are already known from the node's style. If a dimension is None, the measure function must compute it.

See: taffy Size<Option<f32>>

waxy.AvailableSize

AvailableSize(
    width: AvailableSpaceValue, height: AvailableSpaceValue
)

Available space for measure functions (width/height: Definite | MinContent | MaxContent).

Passed to the measure callback to indicate how much space is available for layout. Each dimension is one of the available-space variants.

See: taffy Size<AvailableSpace>

Value types

waxy.Length

Length(value: float)

A length value in pixels.

Used for size, padding, border, gap, margin, inset, and grid track sizing fields.

Raises InvalidLength if value is NaN.

See: taffy Dimension::Length, MDN <length>

waxy.Percent

Percent(value: float)

A percentage value (0.0 to 1.0).

Used for size, padding, border, gap, margin, inset, and grid track sizing fields. Raises InvalidPercent (a subclass of both WaxyException and ValueError) if value is outside the range [0.0, 1.0].

See: taffy Dimension::Percent, MDN <percentage>

waxy.Auto

Auto()

Automatic sizing or placement.

Used for size, margin, inset, flex-basis, and grid placement fields.

See: taffy Dimension::Auto

waxy.MinContent

MinContent()

CSS min-content intrinsic sizing.

The smallest size that can fit the item's contents with all soft line-wrapping opportunities taken. Used in available space (measure functions) and grid track sizing.

See: taffy MinTrackSizingFunction::MinContent, MDN min-content

waxy.MaxContent

MaxContent()

CSS max-content intrinsic sizing.

The smallest size that can fit the item's contents with no soft line-wrapping opportunities taken. Used in available space (measure functions) and grid track sizing.

See: taffy MinTrackSizingFunction::MaxContent, MDN max-content

waxy.Definite

Definite(value: float)

A definite available space in pixels.

Used only in AvailableSize (measure function input) to represent a concrete pixel measurement of available space.

See: taffy AvailableSpace::Definite

waxy.Fraction

Fraction(value: float)

A fractional unit of remaining grid space (CSS fr unit).

After fixed lengths and percentages are allocated, remaining space is divided among fractional tracks proportionally. For example, Fraction(1) and Fraction(2) in the same grid get 1/3 and 2/3 of remaining space.

Used only in grid track sizing (grid_template_, grid_auto_).

See: taffy MaxTrackSizingFunction::Fraction, MDN <flex> (fr unit)

waxy.FitContent

FitContent(limit: Length | Percent)

CSS fit-content() grid track sizing function.

Grows up to a specified limit, then clamps: max(min_content, min(max_content, limit)). The limit must be a Length or Percent.

Used only in grid track sizing.

See: taffy MaxTrackSizingFunction::FitContent, MDN fit-content()

waxy.Minmax

CSS minmax() grid track sizing function.

Defines a size range: min sets the minimum track size, max sets the maximum.

  • min: Length | Percent | Auto | MinContent | MaxContent
  • max: Length | Percent | Auto | MinContent | MaxContent | Fraction | FitContent

Used only in grid track sizing.

See: taffy TrackSizingFunction, MDN minmax()

waxy.GridLine

GridLine(index: int)

A 1-based grid line index (negative indices count from the end).

Used in GridPlacement.start and GridPlacement.end.

Raises InvalidGridLine if index is 0 (grid lines are 1-based; negative indices count from the end).

See: taffy GridPlacement::Line, MDN Line-based placement

waxy.GridSpan

GridSpan(count: int)

Span a number of grid tracks.

Used in GridPlacement.start and GridPlacement.end.

Raises InvalidGridSpan if count is 0 (must span at least 1 track).

See: taffy GridPlacement::Span, MDN grid-column-start (span)

waxy.GridPlacement

GridPlacement(
    start: GridPlacementValue | None = None,
    end: GridPlacementValue | None = None,
)

A start/end pair of grid placements for a child item.

Each of start and end is a GridPlacementValue (GridLine | GridSpan | Auto). Defaults both to Auto (the CSS default for unplaced items).

See: taffy Line<GridPlacement>, MDN grid-row, MDN grid-column

Type aliases

waxy.DimensionValue

DimensionValue = Length | Percent | Auto

A dimension value used for sizes, margins, insets, and flex-basis: Length, Percent, or Auto.

waxy.LengthPercentageValue

LengthPercentageValue = Length | Percent

A length-or-percentage value used for padding, border, and gap: Length or Percent.

waxy.GridTrackValue

GridTrackValue = (
    Length
    | Percent
    | Auto
    | MinContent
    | MaxContent
    | Fraction
    | Minmax
    | FitContent
)

A grid track sizing value used in grid_template_ and grid_auto_ fields.

waxy.GridTrackMinValue

GridTrackMinValue = (
    Length | Percent | Auto | MinContent | MaxContent
)

Minimum sizing bound for a Minmax grid track.

waxy.GridTrackMaxValue

GridTrackMaxValue = (
    Length
    | Percent
    | Auto
    | MinContent
    | MaxContent
    | Fraction
    | FitContent
)

Maximum sizing bound for a Minmax grid track.

waxy.GridPlacementValue

GridPlacementValue = GridLine | GridSpan | Auto

A grid placement value used in GridPlacement start and end: GridLine, GridSpan, or Auto.

waxy.AvailableSpaceValue

AvailableSpaceValue = Definite | MinContent | MaxContent

Available space value for measure functions: Definite, MinContent, or MaxContent.

Enums

waxy.Display

How the node should be displayed.

Block instance-attribute

Block: Display

Block layout.

Flex instance-attribute

Flex: Display

Flexbox layout.

Grid instance-attribute

Grid: Display

CSS Grid layout.

Nil instance-attribute

Nil: Display

No display (maps to CSS display: none).

waxy.Position

How the node should be positioned.

Relative instance-attribute

Relative: Position

Positioned according to normal flow, then offset.

Absolute instance-attribute

Absolute: Position

Removed from normal flow and positioned relative to its containing block.

waxy.FlexDirection

The direction of a flex container's main axis.

Row instance-attribute

Items are laid out in a row (left to right).

Column instance-attribute

Column: FlexDirection

Items are laid out in a column (top to bottom).

RowReverse instance-attribute

RowReverse: FlexDirection

Items are laid out in a row in reverse order (right to left).

ColumnReverse instance-attribute

ColumnReverse: FlexDirection

Items are laid out in a column in reverse order (bottom to top).

waxy.FlexWrap

Whether flex items wrap.

NoWrap instance-attribute

NoWrap: FlexWrap

Items are forced onto a single line.

Wrap instance-attribute

Wrap: FlexWrap

Items wrap onto multiple lines.

WrapReverse instance-attribute

WrapReverse: FlexWrap

Items wrap onto multiple lines in reverse order.

waxy.AlignItems

Alignment of items along the cross axis.

Start instance-attribute

Start: AlignItems

Align to the start of the cross axis.

End instance-attribute

Align to the end of the cross axis.

FlexStart instance-attribute

FlexStart: AlignItems

Align to the start of the cross axis (respects flex-direction).

FlexEnd instance-attribute

FlexEnd: AlignItems

Align to the end of the cross axis (respects flex-direction).

Center instance-attribute

Center: AlignItems

Center along the cross axis.

Baseline instance-attribute

Baseline: AlignItems

Align to the first baseline.

Stretch instance-attribute

Stretch: AlignItems

Stretch to fill the cross axis.

waxy.AlignContent

Alignment of content within the container.

Start instance-attribute

Start: AlignContent

Pack lines to the start of the container.

End instance-attribute

Pack lines to the end of the container.

FlexStart instance-attribute

FlexStart: AlignContent

Pack lines to the start of the container (respects flex-direction).

FlexEnd instance-attribute

FlexEnd: AlignContent

Pack lines to the end of the container (respects flex-direction).

Center instance-attribute

Center: AlignContent

Center lines within the container.

Stretch instance-attribute

Stretch: AlignContent

Stretch lines to fill the container.

SpaceBetween instance-attribute

SpaceBetween: AlignContent

Distribute lines evenly; first line at start, last at end.

SpaceEvenly instance-attribute

SpaceEvenly: AlignContent

Distribute lines with equal space around each line.

SpaceAround instance-attribute

SpaceAround: AlignContent

Distribute lines with half-size spaces on the edges.

waxy.Overflow

How content overflows its container.

Visible instance-attribute

Visible: Overflow

Content is not clipped and may overflow.

Clip instance-attribute

Clip: Overflow

Content is clipped without a scrollbar.

Hidden instance-attribute

Hidden: Overflow

Content is clipped and hidden; scroll position cannot be changed programmatically.

Scroll instance-attribute

Scroll: Overflow

Content is clipped but scrollable.

waxy.GridAutoFlow

How grid items are auto-placed.

Row instance-attribute

Place items by filling each row.

Column instance-attribute

Column: GridAutoFlow

Place items by filling each column.

RowDense instance-attribute

RowDense: GridAutoFlow

Place items by filling each row, backfilling gaps.

ColumnDense instance-attribute

ColumnDense: GridAutoFlow

Place items by filling each column, backfilling gaps.

waxy.BoxSizing

Box sizing model.

BorderBox instance-attribute

BorderBox: BoxSizing

Width and height include padding and border.

ContentBox instance-attribute

ContentBox: BoxSizing

Width and height apply to the content area only.

waxy.TextAlign

Text alignment.

Auto instance-attribute

Auto: TextAlign

Automatic text alignment.

LegacyLeft instance-attribute

LegacyLeft: TextAlign

Left-aligned text.

LegacyRight instance-attribute

LegacyRight: TextAlign

Right-aligned text.

LegacyCenter instance-attribute

LegacyCenter: TextAlign

Centered text.

Exceptions

Exception
 ├── KeyError
 │    └── InvalidNodeId [TaffyException]
 ├── ValueError
 │    ├── InvalidPercent [WaxyException]
 │    ├── InvalidLength [WaxyException]
 │    ├── InvalidGridLine [WaxyException]
 │    └── InvalidGridSpan [WaxyException]
 └── WaxyException
      ├── InvalidPercent [ValueError]
      ├── InvalidLength [ValueError]
      ├── InvalidGridLine [ValueError]
      ├── InvalidGridSpan [ValueError]
      └── TaffyException
           ├── ChildIndexOutOfBounds
           ├── InvalidParentNode
           ├── InvalidChildNode
           ├── InvalidInputNode
           └── InvalidNodeId [KeyError]

waxy.WaxyException

Bases: Exception

Base exception for all waxy errors.

waxy.TaffyException

Bases: WaxyException

Base exception for all taffy errors.

waxy.InvalidPercent

Bases: WaxyException, ValueError

Raised when Percent(value) is called with a value outside [0.0, 1.0].

waxy.InvalidLength

Bases: WaxyException, ValueError

Raised when Length(value) is called with a NaN value.

waxy.InvalidGridLine

Bases: WaxyException, ValueError

Raised when GridLine(index) is called with index 0 (grid lines are 1-based).

waxy.InvalidGridSpan

Bases: WaxyException, ValueError

Raised when GridSpan(count) is called with count 0 (must span at least 1 track).

waxy.InvalidNodeId

Bases: TaffyException, KeyError

Raised when a node ID is not valid (node may have been removed).

waxy.ChildIndexOutOfBounds

Bases: TaffyException

Child index is out of bounds.

waxy.InvalidParentNode

Bases: TaffyException

Parent node is invalid.

waxy.InvalidChildNode

Bases: TaffyException

Child node is invalid.

waxy.InvalidInputNode

Bases: TaffyException

Input node is invalid.