A comprehensive UI library for LÖVE Framework based on flexbox
Modern CSS-like layout system with full flexbox and grid support for building responsive UIs.
9-patch NinePatch theming with state support (normal, hover, pressed, disabled).
Built-in animation support for smooth transitions and effects with easing functions.
Viewport units (vw, vh, %) for automatic resizing and responsive layouts.
Optional immediate mode support alongside traditional retained mode rendering.
Rich event handling with callbacks, focus management, and input fields.
local FlexLove = require("FlexLove")
-- Initialize with base scaling and theme
FlexLove.init({
baseScale = { width = 1920, height = 1080 },
theme = "space"
})
-- Create a button
local button = FlexLove.new({
width = "20vw",
height = "10vh",
backgroundColor = Color.new(0.2, 0.2, 0.8, 1),
text = "Click Me",
themeComponent = "button",
onEvent = function(element, event)
print("Button clicked!")
end
})
-- In your love callbacks
function love.update(dt)
FlexLove.update(dt)
end
function love.draw()
FlexLove.draw()
end
The API reference is available in two formats:
These docs are auto-generated from LuaLS annotations using the Lua Language Server.
Add the modules directory and FlexLove.lua into your LÖVE project.
git clone https://github.com/mikefreno/FlexLove.git
cp -r FlexLove/modules your-project/
cp FlexLove/FlexLove.lua your-project/