JustifyContent

Main axis alignment enumeration

Defines how flex items are aligned and spaced along the main axis. This corresponds to the CSS justify-content property.

Example

import { Style, JustifyContent } from "taffy-layout"; const style = new Style(); style.justifyContent = JustifyContent.Center; // Center items style.justifyContent = JustifyContent.SpaceBetween; // Distribute evenly

Enumeration Members

Enumeration MemberValueDescription
Center4Items centered along the main axis
End1Items packed toward the end of the main axis
FlexEnd3Items packed toward the end of the flex container
FlexStart2Items packed toward the start of the flex container
SafeCenter13Safe center alignment that avoids start-edge overflow
SafeEnd10Safe end alignment that avoids start-edge overflow
SafeFlexEnd12Safe flex-end alignment that avoids start-edge overflow
SafeFlexStart11Safe flex-start alignment that avoids start-edge overflow
SafeStart9Safe start alignment that avoids start-edge overflow
SpaceAround7Items evenly distributed with equal space around each
SpaceBetween6Items evenly distributed with first/last at edges
SpaceEvenly8Items evenly distributed with equal space between each
Start0Items packed toward the start of the main axis
Stretch5Items stretched along the main axis

© 2026 ByteLand Technology Limited