UI Labs - Modern Storybook Plugin for Roblox

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
1 Like