When you work with Declarative UI Libraries like Roact or Fusion , creating User Interfaces with code becomes challenging when you try to preview them. UI Labs aims to solve this problem:
Allows you to preview your UI code instantly without running your game.
Features a Hot-Reloader that updates your changes in real-time.
Provides a Sandboxed environment for your code to run in, you dont have to worry about reverting all your changes.
Native support for Fusion, Roact, React, Vide and Iris
Support for Generic Stories allowing you to adapt the stories to your own Library or Framework
The docs are not empty, the api reference is. it’s work in progress
This plugin is useful for programmers using react/fusion. It might be also very useful for executing some arbitrary code in edit mode. (like InCommand)
UI Labs just like any other storybook-like plugin is only used for testing your components.
So you shouldnt create your components inside stories, stories are only used to require those components and render them.
As a rule, you should never require story files anywhere in your code and stories shouldnt also require eachother, these should only be required by UI Labs.
Example:
Correct
-- story
local component = require(...) -- requires is the component
return function()
component()
end
Wrong
-- story
function component() -- creates the component
...
end
return function()
component()
end