Styling

Comprehensive guide to Taffy's styling properties.

Taffy's styling API is modeled after CSS. Below are the main property groups; the Style API reference lists every exposed property and its accepted values.

Layout Mode

Core properties that define how a node behaves.

PropertyDescription
displayFlex (default), Grid, Block, FlowRoot, or None.
directionLtr (default) or Rtl logical layout direction.
float / clearFloat placement and clearance in block layout.
positionRelative (flow) or Absolute (overlay).
overflowVisible, Clip, Hidden, or Scroll.
insettop, bottom, left, right for positioning.

Sizing & Spacing

Control dimensions and spacing.

PropertyDescription
size / minSize / maxSizeWidth and height control.
aspectRatioRatio between width and height.
marginOuter spacing.
paddingInner spacing.
borderBorder width (space only).
gapSpacing between Flex/Grid items.

Flexbox Layout

Properties for 1D layouts.

PropertyDescription
flexDirectionRow, Column, RowReverse, or ColumnReverse.
flexWrapWrap, WrapReverse, or NoWrap.
flexBasisInitial main size.
flexGrowGrowth factor.
flexShrinkShrink factor.
justifyContentMain-axis alignment.
alignItemsDefault cross-axis alignment.
alignSelfOverride alignment for item.
alignContentAlign wrapping lines.

Grid Layout

Properties for 2D layouts.

PropertyDescription
gridTemplateRows / gridTemplateColumnsDefine rows and columns.
gridTemplateAreas and area countsNamed areas and template dimensions.
justifyItems / justifySelfDefault and per-item inline alignment.
gridColumnPlace items in columns.
gridRowPlace items in rows.
gridAutoFlowAuto-placement algorithm.

© 2026 ByteLand Technology Limited