Skip to content

Instantly share code, notes, and snippets.

@onespaceman
Created April 26, 2026 18:09
Show Gist options
  • Select an option

  • Save onespaceman/4169a28dbc4d43aed605cd85485d8d0f to your computer and use it in GitHub Desktop.

Select an option

Save onespaceman/4169a28dbc4d43aed605cd85485d8d0f to your computer and use it in GitHub Desktop.
shadowdom panel example
command.define {
name = "TEST PANEL: OPEN",
run = function(args) showPanel() end
}
function showPanel()
local panel = dom.div { id = "panel-content" }
-- implement script in lua like this ->
panel.onclick = function() panel.textContent = panel.textContent .. "\n Clicked on panel from lua" end
local styles = dom.style {}
styles.textContent = [[
#panel-content {
height: 100vh;
background: darkgreen;
white-space: pre-wrap;
}
]]
editor.showPanel("lhs", 0.5, { styles, panel }) -- <- pass array of elements which can include style elements
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment