Introduction
A simple module to manage Roblox's UI components inspired by React.
Fragment is a simple module I made to manage Roblox's imperative UI instance system inspired by React. It currently supports state management, effects, declarative rendering and instance creation, spring-based animation, global stores, reusable components and more, allowing you to build reactive user interfaces whilst still using default Roblox's UI components. It's also previewable in Flipbook and UI Labs — see the Storybook guide.
Feel free to support my work by following my Roblox profile.
If you wanna test it out yourself, you can either download a copy here or play the demo game on roblox.
What Fragment provides
- Handles — bind a renderer to a specific UI path
- Components — reusable template-backed renderers with full reactive access
- Instance creation — build Instances from code with
Fragment.create, no Studio template required - Mounting anywhere —
Fragment.mountrenders into any Instance, not just a fixed PlayerGui path - Reactive bindings — local
bind,derive,hold,await... - Spring-based motion —
handle:springanimates toward a target with real damped physics - Replicated Attributes —
handle:attributereacts to a Roblox Instance Attribute changing - Global stores — centralized reactive state shared across Handles
- Contexts — shared value objects
- Composable hooks — reusable logic via
Fragment.compose - Diffing containers — efficient dynamic child management, plus a one-call
Eachfor lists - Effect lifecycle — automatic cleanup between renders, with dependency-array skipping
- Storybook previews — compatible with Flipbook and UI Labs
API Reference
Made with ❤️ - @Cheeteau