Hi all,
I’ve released plugin.yoga — a native C plugin that brings https://yogalayout.dev/ (CSS Flexbox) layout to Solar2D.
What it does
Full CSS Flexbox layout computation — flex-direction, justify-content, align-items, flex-grow/shrink, gap, aspect-ratio, percentage sizing, and more.
Compute layout in a tree of nodes, then read the positions to place your display objects.
Platforms
macOS Simulator, Windows Simulator, iOS (device + simulator), Android (arm64 + armv7). Prebuilt binaries on GitHub Releases — no native build tools
needed.
Quick example
local yoga = require("plugin.yoga")
local root = yoga.newNode()
root:setWidth(320)
root:setHeight(480)
root:setFlexDirection(yoga.FlexDirection.column)
root:setPadding(yoga.Edge.all, 10)
root:setGap(yoga.Gutter.all, 8)
local header = yoga.newNode()
header:setHeight(60)
local content = yoga.newNode()
content:setFlexGrow(1)
local footer = yoga.newNode()
footer:setHeight(40)
root:insertChild(header, 0)
root:insertChild(content, 1)
root:insertChild(footer, 2)
root:calculateLayout()
-- Read computed positions
print(header:getLayout()) -- 10, 10, 300, 60
print(content:getLayout()) -- 10, 78, 300, 354
print(footer:getLayout()) -- 10, 440, 300, 40
root:freeRecursive()
Setup
Add to your build.settings:
local yoga_base = "https://github.com/labolado/solar2d-plugin-yoga/releases/download/v6/"
settings = {
plugins = {
["plugin.yoga"] = {
publisherId = "com.labolado",
supportedPlatforms = {
["mac-sim"] = { url = yoga_base .. "plugin.yoga-mac-sim.tgz" },
android = { url = yoga_base .. "plugin.yoga-android.tgz" },
iphone = { url = yoga_base .. "plugin.yoga-iphone.tgz" },
["iphone-sim"] = { url = yoga_base .. "plugin.yoga-iphone-sim.tgz" },
["win32-sim"] = { url = yoga_base .. "plugin.yoga-win32-sim.tgz" },
},
},
},
}
Feedback and issues welcome on GitHub.




