Spacers and dividers
Spacers take up free space so siblings are pushed apart, and dividers draw thin rule lines. They need no id, so they are safe inside loops.
Leaves with no id and no block. Safe to use in loops.
Example
static void toolbar(void) {
Row("Toolbar", .layout = { .sizing = { Grow(), Fixed(40) },
.childAlignment = { .y = AlignYCenter() } }) {
Text("File");
Text("Edit");
HSpacer(); // pushes Settings to the right
Text("Settings");
}
HDivider(.thickness = 1, .color = ColorHex(0x333333));
Spacer(.height = Fixed(12)); // fixed 12px gap
}
Reference
| Name | Form | What it does | Page |
|---|---|---|---|
HSpacer | HSpacer() | Grows along the width. Pushes siblings apart in a Row. | Spacer and divider |
VSpacer | VSpacer() | Grows along the height. Pushes siblings apart in a Column. | Spacer and divider |
Spacer | Spacer(.width = ..., .height = ...) | Spacer with explicit sizing per axis. Unset axes are Fit(). Fields: CC_SpacerOpts. | Spacer and divider |
HDivider | HDivider(.length, .thickness, .color) | Horizontal rule. length 0 grows, thickness defaults to 1, color to the global font color. Fields: CC_DividerOpts. | Spacer and divider |
VDivider | VDivider(.length, .thickness, .color) | Vertical rule. Same fields as HDivider. | Spacer and divider |
CC_HSpacer, CC_VSpacer, CC_Spacer, CC_HDivider, CC_VDivider | functions | What the macros above call. |