> ## Documentation Index
> Fetch the complete documentation index at: https://gabibou-ui.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Loading and key access

> Practical Gabibou UI guide: loading and key access

These features are optional. A basic menu can use [Getting started](https://gabibou-ui.mintlify.site/getting-started/quickstart.md) directly.

## Show menu construction progress

After loading `UI`, this block creates its own window:

```lua theme={null}
local window = UI:Create({
    Id = "LoadedMenu", Title = "My menu",
    Loading = {Title = "Preparing", Variant = "Compact"},
    Tabs = {{
        Title = "Home", Icon = "home",
        Controls = {{
            Type = "Toggle", Id = "effects", Title = "Effects", Value = true,
            Callback = function(enabled) print("Effects:", enabled) end,
        }},
    }},
})
```

`Create` builds from a table. Every declarative control needs a unique `Id`. Its loader reports control construction progress.

## Drive a separate loader

```lua theme={null}
local loader = UI:CreateLoader({Title = "Preparing", Variant = "Centered", Height = 300})
loader:SetProgress(0.25, "Reading preferences")
loader:SetStatus("Preparing the menu")
loader:Complete("Ready")
```

Replace these demonstration steps with real tasks. Progress represents work reported by your code. Variants are `Compact`, `Centered`, `Minimal`. `SetProgress` accepts 0-1; `Complete` finishes and destroys the loader; `Destroy` cancels it.

## Validate a key on a Roblox server

`Validate(key)` returns `true, result` to accept or `false, message` to reject. The library does not supply your authentication system.

For Studio:

1. Copy [key\_server.example.luau](https://github.com/Gabibou455/GabibouUI/blob/main/gabibou_ui/key_server.example.luau) into a Script under `ServerScriptService`. Replace `CHANGE_ME` in that server script.
2. Copy [starter.luau](https://github.com/Gabibou455/GabibouUI/blob/main/gabibou_ui/starter.luau) into a LocalScript under `StarterPlayerScripts`, keeping `ReplicatedStorage.GabibouUI` installed.

The server creates `GabibouValidateKey`. Once configured, client wiring after loading `UI` can use:

```lua theme={null}
local validateKey = game:GetService("ReplicatedStorage"):WaitForChild("GabibouValidateKey")
UI:CreateKeySystem({
    Title = "Menu access",
    Validate = function(key)
        return validateKey:InvokeServer(key)
    end,
    OnSuccess = function()
        local window = UI:CreateWindow("My menu")
        window:Tab("Home", "home"):Paragraph("Access granted")
    end,
})
```

Keep keys and authorization decisions on the server. The client displays a result; every protected server action must check authorization.

## Existing providers

`UI:KeyProvider(name, options)` adapts an SDK **you supply** into a `Validate` callback. Providers: `Luarmor`, `Vampauth`, `KeyAuth`, `Custom`. It does not download SDKs. See [provider examples](https://github.com/Gabibou455/GabibouUI/blob/main/gabibou_ui/mintlify/examples/key-providers.mdx).

`UI:Launch(spec)` coordinates key validation, `Steps`, loading and declarative creation. Its session exposes `Status`, `Window`, `Loader`, `Gate`, `Cancel()` and `Destroy()`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.