playbit / docs

Builtin Elements

UIBox* UISpacer(UISize size);
UIBox* UIText(PBUIFont font, PBStrSlice text);
UIBox* UIDiv(PBStrSlice label);

UISpacer

The UI spacer adds space along the primary layout axis (parent->style.direction).

For example:

UIDiv(PBStrLit("Rect"))->style = UIStyleMake(
    .size = UI_size2(UI_px(20), UI_px(20)), .backgroundColor = UI_rgb(1, 0, 0));

UISpacer(UI_px(40));

UIDiv(PBStrLit("Rect"))->style = UIStyleMake(
    .size = UI_size2(UI_px(20), UI_px(20)), .backgroundColor = UI_rgb(1, 0, 0));

Would render: