Making Your First UI
Basic Structure
Step 1: Define a UI Layout
local my_ui = {
header = {
layout = {
left = { justify = "flex-start" },
center = { justify = "center" },
right = { justify = "flex-end" },
},
elements = {
left = {
{
type = "group",
items = {
{ type = "logo", image = "bd_100.png" },
{ type = "text", title = "My UI", subtitle = "Made with BDUK" }
}
}
},
center = { { type = "tabs" } },
right = { { type = "namecard", avatar = "avatar_placeholder.jpg", name = "Player", title = "Developer", level = 1, tier = "gold" } }
}
},
content = {
pages = {
main_page = {
index = 1,
title = "Main Page",
layout = { center = 6 },
center = {
type = "input_groups",
title = "Options",
id = "basic_inputs",
layout = { columns = 1 },
groups = {
{
header = "General Settings",
inputs = {
{ id = "setting_1", type = "text", label = "Your Name" },
{ id = "setting_2", type = "number", label = "Age" }
}
}
},
buttons = {
{ id = "save", label = "Save", on_click = function(data) ... end, class = "primary" }
}
}
}
}
},
footer = {
layout = {
left = { justify = "flex-start" },
center = { justify = "center" },
right = { justify = "flex-end" },
},
elements = {
left = {
{
type = "buttons",
buttons = {
{ id = "back", label = "Back", on_click = function(data) ... end, class = "secondary" }
}
}
},
center = { { type = "text", text = "Made with 💙 by BOII Development" } },
right = {
{ type = "actions", actions = { { key = "E", label = "Confirm", on_keypress = function(data) ... end, }, { key = "ESC", label = "Close", on_keypress = function(data) ... end, } } }
}
}
}
}Step 2: Show the UI
Adding Components
Pages Explained
Each page has:
Tips
You’re Ready!
Last updated