Hello! I want to add controls to my codebase, which does not use a UI library like React or Roact.
I use Horacekat as stories at the moment and want to move over, however functional stories with controls only error.
Example:
local controls = {
text = "Functional Story",
}
return {
summary = "This story uses a function with a cleanup callback to create and mount the gui elements. This works similarly to Hoarcekat stories but also supports controls and other metadata. Check out the source to learn more",
controls = controls,
story = function(parent, props)
local label = Instance.new("TextLabel")
label.Text = props and props.controls and props.controls.text or "Text unknown"
label.Font = Enum.Font.Gotham
label.TextColor3 = Color3.fromRGB(0, 0, 0)
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
label.TextSize = 16
label.AutomaticSize = Enum.AutomaticSize.XY
local padding = Instance.new("UIPadding")
padding.PaddingTop = UDim.new(0, 8)
padding.PaddingRight = padding.PaddingTop
padding.PaddingBottom = padding.PaddingTop
padding.PaddingLeft = padding.PaddingTop
padding.Parent = label
label.Parent = parent
return function()
label:Destroy()
end
end,
}
Hello! I want to add controls to my codebase, which does not use a UI library like React or Roact. I use Horacekat as stories at the moment and want to move over, however functional stories with controls only error. Example: