kohltastrophe/flux

Reactive UI library for Luau.

Flux Docs Download Get it on the Creator Marketplace




Be lazy. Do more. Go fast.

Flux is a reactive UI library for Luau. It's strictly typed for accurate autocomplete, batches updates once per frame, and keeps syntax terse enough to read like plain Luau.

CI Coverage License GitHub Release


Be lazy yet effective

Editor autocomplete for Flux: choosing the Frame class, completing the inherited Name property, and a type error on an invalid property.

Flux leans on Luau's type checker so your editor does the heavy lifting. When you declare a TextLabel or Frame, you get autocomplete for every valid property, event, and expected type.


Do more with less

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Flux = require(ReplicatedStorage.Flux)
local new = Flux.new

local count = Flux(0)

new "ScreenGui" {
	Parent = playerGui,

	new "TextButton" {
		Size = UDim2.fromOffset(200, 50),
		Text = function() return `Clicks: {count}` end,
		Activated = function() count(count + 1) end,
	},
}

Every reactive node supports __call and operator overloading, so reading and writing state takes no extra ceremony. Call count() to read and count(1) to write. Arithmetic and string interpolation track dependencies automatically, so reactive expressions read like normal Luau (use explicit count() == 0 or count() < 5 reads in comparisons).


Go fast waste nothing

Luau reactivity benchmark

Dormant computations sleep with zero subscriptions until something observes them. Active bindings batch updates once per frame and run in dependency order. If a computed value doesn't change, downstream bindings don't re-run.


Batteries Included

Flux includes the building blocks you need for Roblox interfaces:

Installation

Install kohltastrophe/flux with Wally or pesde (pesde add kohltastrophe/flux), or download Flux.rbxm from Releases and place the module in ReplicatedStorage. Rojo users can sync the src directory directly.

Read the Getting Started guide to build your first component.

Acknowledgments

Flux is inspired by:

Sponsors

Flux is free and MIT-licensed. If Flux is useful to you or your team, you can support its development through GitHub Sponsors or Ko-fi.

GitHub Sponsors  Ko-fi Sponsors

License

Flux is released under the MIT License.