Skip to content

kohltastrophe/flux

Repository files navigation

Flux Docs Download Get it on the Creator Marketplace




Be lazy. Do more. Go fast.

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.

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 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.


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,
	},
}

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.


Go fast stay lazy

Luau reactivity benchmark

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.


Batteries Included

Lazy reactivity is the engine. On top of it, Flux ships the rest of what you need to build interfaces, all strictly typed:

Installation

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.

Acknowledgements

Flux is heavily inspired by:

Sponsors

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

License

Flux is released under the MIT License.

About

Lazy fine-grained reactivity for Luau.

Resources

License

Stars

16 stars

Watchers

0 watching

Forks

Sponsor this project

 

Contributors