How SDUI components are sized, padded, and positioned within their parents.
| Type | JSON | Behavior |
|---|---|---|
| fixed | { "width": 200 } | Exact dp value |
| fill | { "width": "fill" } | Expand to fill available space (100%) |
| wrap | { "width": "wrap" } | Shrink to content (fit-content) |
| aspectRatio | { "width": "fill", "aspectRatio": 1.333 } | Width/height ratio (e.g. 4:3 = 1.333) |
Priority: individual sides → horizontal/vertical → all. Values in dp.
{ "padding": { "all": 16 } }
{ "padding": {
"horizontal": 12,
"vertical": 8
}
}{ "padding": {
"top": 16,
"bottom": 8,
"start": 12,
"end": 12
}
}Applied on a child to control how it behaves within its Row/Column parent.
| Field | Type | Description |
|---|---|---|
| weight | float | Flex weight — distributes remaining space proportionally |
| align | start | center | end | Override cross-axis alignment for this specific child |
3x3 grid of alignment positions for children within a Box container.