该页面暂无翻译,已显示英文版本。
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 Member | Value | Description |
|---|---|---|
Center | 4 | Items centered along the main axis |
End | 1 | Items packed toward the end of the main axis |
FlexEnd | 3 | Items packed toward the end of the flex container |
FlexStart | 2 | Items packed toward the start of the flex container |
SpaceAround | 7 | Items evenly distributed with equal space around each |
SpaceBetween | 6 | Items evenly distributed with first/last at edges |
SpaceEvenly | 8 | Items evenly distributed with equal space between each |
Start | 0 | Items packed toward the start of the main axis |
Stretch | 5 | Items stretched along the main axis |