editorPanel
local edui = require("@builtin::~edui.framework")
return {
title = "My Tab", -- the tab's label (`label` is accepted too)
order = 60, -- sort position in the menu
dock = "bottom", -- seeds the FIRST arrangement: left | right | bottom | center
menu = "scene", -- which top-bar menu lists it; an unknown name creates that menu
startClosed = true, -- registered closed; opened from the menu
build = function() -- the tab's body, called again whenever it should change
return edui.panel{ body = edui.text{ text = "hello" } }
end,
}
build is the only required field. The tab id defaults to the folder stem
(myTab.editorPanel → myTab); an explicit id overrides it, and a duplicate
id replaces the prior registration. An init may return a LIST of specs when one
asset carries several tabs — a spec this registration no longer declares has its
tab taken down.
The spec is forwarded whole to edui.shell.addPanel, so anything the shell
accepts (badge, badgeColor, …) works here; man edui.shell is its contract.
build may return nil to mean "nothing changed, keep what is drawn" — the
shell rebuilds open tabs on a timer, and a panel that re-publishes an identical
tree pays for it. Only the ACTIVE tab of a dock leaf is rebuilt at all.
An init.luau that fails to load does not break the editor: its tab comes up
carrying the failure — the path and the error, selectable — so a panel that will
not compile says so where you would look for it.
Every instance of this type becomes a tab: the ones in the open world, and the ones the built-in library ships, on the same terms.
Adding a tab to a project is creating a new editorPanel asset: it comes from
the template above and registers its tab at once, wherever under /source it
was made (editorPanels/ is the type's conventional folder). Editing the
init.luau re-registers the tab, deleting the folder removes it. Nothing
registers panels by name anywhere.
guides { path = "editor/edui/edui" } — the guide beside this type, inside
the edui package — covers the build model, where panel state lives, and the
edui.* surface a body draws with.
In the Inspector
Panels: each panel id this file registers (panelRef:panelIds()), whether it is open, an Open action for it, and Open for the source. A file whose init.luau does not load says why.