AROYN UI LIBRARY / GETTING STARTED

Quick start

A complete local interface with a value, callback and configuration actions.

Create a working interface#

This example is runnable after the local standalone installation. It changes only interface state and prints callback values. Embedded images need compatible writefile/custom-asset APIs; inspect Aroyn.Distribution.Assets if branding is unavailable.

LUAU
local Aroyn = loadstring(game:HttpGet(
    "https://lib.aroyn.xyz/stable/0.1.0/Aroyn.lua"
))()
local parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local window = Aroyn:CreateWindow({
    Parent = parent, Id = "docs-example", Title = "AROYN", Logo = Aroyn.Logo,
    Config = {Namespace = "docs-quickstart", AutoLoad = false, AutoSave = false},
})
local page = window:CreatePage({Name = "General", Icon = "settings"})
local section = page:CreateSection({Title = "Preferences"})

local enabled = section:CreateToggle({
    Name = "Enable example", Flag = "enabled", Default = false,
    Callback = function(value) print("Enabled:", value) end,
})
section:CreateButton({
    Name = "Set example", Text = "Enable", Variant = "Primary",
    Callback = function() enabled:SetValue(true, true) end,
})

-- The namespace above keeps this example separate from other applications.
section:CreateButton({Name = "Save preferences", Text = "Save", Callback = function()
    local ok, info = window:SaveConfig("main")
    window:Notify({Title = ok and "Saved" or "Save failed",
        Description = info.Message, Type = ok and "Success" or "Error"})
end})
section:CreateButton({Name = "Restore preferences", Text = "Load", Callback = function()
    local ok, info = window:LoadConfig("main") -- does not call gameplay callbacks
    if not ok then warn(info.Code, info.Message) end
end})

Understand the hierarchy#

HandleResponsibility
AroynCreates or attaches windows. Holds theme and asset fields.
WindowOwns pages, popups, overlays and its configuration manager.
PageOwns sections and is preserved across navigation.
SectionCreates controls and lays out rows.
ControlOwns typed value, user interactions and callback.

Change values deliberately#

Constructors do not call ordinary Callback. SetValue(value) is silent by default; SetValue(value, true) notifies on a changed value. Config loading is silent by default, too. UI state is not permission to start your application’s automation.

Finish safely#

LUAU
-- Call when your application is finished with the interface:
window:Destroy()
-- Also disconnect any events owned by your application adapter.
Your first windowAn explicit namespace and a second page.ComponentsCommon options and handle behavior.

Version-pinned installation#

The examples above use the verified immutable v0.1.0 import. Prefer it for predictable dependencies; Latest may change with a future approved Stable release.