Flux is a declarative Luau library for creating user interfaces. It runs on fine-grained lazy reactions, is strictly typed for accurate IntelliSense, and keeps the syntax terse enough that interfaces read almost like plain Luau.
Flux exploits Luau's type checker to its absolute limit, if you're going to be lazy, your editor should do the heavy lifting. The moment you declare an instance like a TextLabel or a Frame, you get zero-guesswork autocomplete for every valid property, event, and expected type.
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,
},
}Flux cuts boilerplate with __call metamethods and full operator overloading on every reactive node, so your keystrokes can be just as lazy as the engine under the hood. This means you can forget :get() and :set(1), just use count() to read and count(1) to write. Arithmetic, comparison, and concatenation operators automatically subscribe, so reactive expressions read like the plain Luau around them.
Most reactive libraries lean on topological sorting, dirty-checking, or a virtual DOM, all of which carry real overhead on the Luau VM. Flux avoids that overhead by being uncompromisingly lazy. It evaluates absolutely nothing until a value is explicitly observed, ensuring that only the exact work a change strictly requires is ever calculated. No over-fetching, no premature rendering, and no wasted CPU cycles; just maximum performance through pure, optimal laziness.
Lazy reactivity is the engine. On top of it, Flux ships the rest of what you need to build interfaces, all strictly typed:
- Reactive primitives -
signal,computed, andeffect, plus stores and context for shared state, andwrapto turn plain tables into reactive ones. - Declarative instances:
newto build andeditto hydrate existing Instances, with scoped lifecycles and cleanup. - Lifecycle & cleanup -
scopetracks every node, instance, and effect it creates and tears them all down with a singleDestroy, including nested child scopes. - Control flow -
showandswitchfor conditional rendering,forValue/forIndexfor keyed mapping, andselectorfor O(1) selection in large lists. - Motion: physics springs, tweens, and perceptual color interpolation, all stepped once per frame.
- Responsive & layout:
viewport,scale, andbreakpointhelpers alongsidepadding,list,grid, andflex. - Async & safety:
asynctasks, error boundaries, and astrictmode that catches impure computations in development.
Download the latest Flux.rbxm from Releases, drop it into Roblox Studio, and place the module in ReplicatedStorage. Rojo users can sync the src directory directly.
From there, the Getting Started guide covers the core concepts and your first reactive components.
Flux is heavily inspired by:
Flux is free and MIT-licensed. Its ongoing development is made possible by its sponsors; if Flux is useful to you or your team, you can support it through GitHub Sponsors.
Current sponsors
Flux is released under the MIT License.