Package Exports
- @rbxts/fusion-3.0
- @rbxts/fusion-3.0/src/init.luau
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts/fusion-3.0) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@rbxts/fusion-3.0
TypeScript bindings for Fusion 3.0 — a modern reactive UI library for Roblox by Elttob.
The underlying library is shipped as its original Luau source; this package adds TypeScript declarations and per-class prop typing via @rbxts/types.
Install
npm install @rbxts/fusion-3.0Usage
import Fusion from "@rbxts/fusion-3.0";
import { Players } from "@rbxts/services";
const scope = Fusion.scoped(Fusion);
const count = Fusion.Value(scope, 0);
Fusion.New(scope, "ScreenGui")({
Parent: Players.LocalPlayer.WaitForChild("PlayerGui"),
[Fusion.Children]: Fusion.New(scope, "TextButton")({
Size: new UDim2(0, 200, 0, 50),
Text: Fusion.Computed(scope, (use) => `Count: ${use(count)}`),
[Fusion.OnEvent("Activated")]: () => count.set(Fusion.peek(count) + 1),
}),
});Documentation
For API reference, tutorials, and everything else, see the official Fusion 0.3 docs. This package exposes the same runtime API — only the syntax is TypeScript.
Differences from upstream
- Distributed as Luau source with TypeScript declarations (no TS-to-Luau compile step).
PropertyTableaccepts object literals ({ Text: "Hi" }) instead ofMap.NewandHydrateare generic:Fusion.New(scope, "Frame")({ ... })type-checks props againstFrame's writable properties.
Credits
Fusion is the work of Daniel P H Fox (Elttob) and contributors. This package only provides TypeScript bindings.
License
MIT. See LICENSE. Upstream Fusion is also MIT.