RazLib

A lightweight, customisable Roblox UI library — loadstring-compatible, zero dependencies.

RazLib gives script developers a complete, polished UI system that loads in one line. Every element is drawn entirely in code — no external models, no asset IDs, no game-ID guards. Drop it into any game.

Short URL
lua
local RazLib = loadstring(game:HttpGet("https://razzles.xyz/RazLib"))()
Raw GitHub
lua
local RazLib = loadstring(game:HttpGet("https://raw.githubusercontent.com/Razzles5170/RazLib/main/RazLib.luau"))()

Quick Start #quickstart

A minimal working script. Load the library, create a window, add a tab, and drop in a button and a toggle.

lua
local RazLib = loadstring(game:HttpGet("https://razzles.xyz/RazLib"))()

local Window = RazLib:CreateWindow({
    Name = "My Script",
    LoadingTitle = "RazLib",
    LoadingSubtitle = "by Razzles",
    Theme = "Default",
    ToggleKeybind = Enum.KeyCode.LeftControl,
})

local Tab = Window:CreateTab("Main", "⚡")

Tab:CreateButton({
    Name = "Print Hello",
    Description = "Prints a message to output.",
    Callback = function()
        print("Hello from RazLib!")
    end,
})

local godToggle = Tab:CreateToggle({
    Name = "God Mode",
    CurrentValue = false,
    Callback = function(value)
        print("God Mode:", value)
    end,
})

godToggle:Set(true)

CreateWindow #createwindow

Creates and displays the main UI window. Must be called before any tabs or elements.

lua
local Window = RazLib:CreateWindow({
    Name = "My Script",
    LoadingTitle = "RazLib",
    LoadingSubtitle = "by Razzles",
    Theme = "Default",
    Icon = 0,
    ToggleKeybind = Enum.KeyCode.LeftControl,
    ShowText = "Show",
    Discord = {
        Enabled = false,
        Invite = "",
        RememberJoins = true,
    },
    ConfigurationSaving = {
        Enabled = false,
        FolderName = "RazLib",
        FileName = tostring(game.PlaceId),
    },
    KeySystem = false,
    KeySettings = {
        Title = "Key System",
        Subtitle = "Enter your key",
        Note = "",
        FileName = "Key",
        SaveKey = true,
        GrabKeyFromSite = false,
        Key = {"your-key-here"},
    },
})
PropertyTypeDescription
NamestringWindow title shown in the topbar.
LoadingTitlestringLarge text on the loading screen.
LoadingSubtitlestringSmaller sub-text below the loading title.
Themestring | tableTheme name string or a custom theme table. Defaults to "Default".
IconnumberAsset ID for the topbar icon. Pass 0 to hide.
ToggleKeybindEnum.KeyCodeKey that shows/hides the window.
ShowTextstringLabel on the mobile show button.
Discord.EnabledbooleanShow a Discord prompt on first load.
Discord.Invitestringdiscord.gg code only — not the full URL.
Discord.RememberJoinsbooleanDon't prompt again if the user already joined.

CreateTab #createtab

Adds a tab to the window's tab bar. Returns a Tab object you use to add elements.

lua
local Tab = Window:CreateTab("Combat", "⚔️")
ParameterTypeDescription
namestringTab label shown in the tab bar.
iconstring?Optional emoji or short string shown beside the label.

Elements #elements

All element methods live on a Tab object. Each method returns a control object with at least a :Set() method so you can update its value from code.

Button #button

A clickable row. Supports an optional description line beneath the name.

lua
Tab:CreateButton({
    Name = "Teleport",
    Description = "Teleport to the spawn point.",
    Callback = function()
        -- action here
    end,
})
PropertyTypeDescription
NamestringButton label.
Descriptionstring?Secondary text shown below the name.
CallbackfunctionCalled when the button is clicked.

Toggle #toggle

A boolean switch. Returns a control with :Set(bool).

lua
local myToggle = Tab:CreateToggle({
    Name = "Speed Boost",
    CurrentValue = false,
    Callback = function(value)
        print("Toggled:", value)
    end,
})

myToggle:Set(true)
PropertyTypeDescription
NamestringToggle label.
CurrentValuebooleanDefault state on creation.
Riskyboolean?Adds a red border to warn the user this action is dangerous.
Flagstring?Key in RazLib.Flags.
Callbackfunction(bool)Called with the new boolean value on change.

Slider #slider

A draggable value picker. Returns a control with :Set(number).

lua
local mySlider = Tab:CreateSlider({
    Name = "Walk Speed",
    Range = {16, 200},
    Increment = 1,
    CurrentValue = 16,
    Suffix = "studs/s",
    Callback = function(value)
        game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = value
    end,
})

mySlider:Set(50)
PropertyTypeDescription
NamestringSlider label.
Range{number, number}Minimum and maximum values.
IncrementnumberStep size between values.
CurrentValuenumberStarting value.
Suffixstring?Unit label appended to the displayed number.
Callbackfunction(number)Called with the new value on change.

Input #input

An inline text field. Returns a control with :Set(string).

lua
local myInput = Tab:CreateInput({
    Name = "Player Name",
    PlaceholderText = "Enter a username...",
    CurrentValue = "",
    Callback = function(value)
        print("Input:", value)
    end,
})

myInput:Set("Razzles")
PropertyTypeDescription
NamestringField label.
PlaceholderTextstringGrey hint shown when the field is empty.
CurrentValuestringPre-filled value.
Callbackfunction(string)Called with the text on enter/focus-lost.

Keybind #keybind

Captures a key press from the user. Returns a control with :Set(Enum.KeyCode).

lua
local myKeybind = Tab:CreateKeybind({
    Name = "Sprint Key",
    CurrentKeybind = Enum.KeyCode.LeftShift,
    HoldToInteract = false,
    Callback = function(key)
        print("Key pressed:", key)
    end,
})

myKeybind:Set(Enum.KeyCode.Q)
PropertyTypeDescription
NamestringKeybind label.
CurrentKeybindEnum.KeyCodeDefault key.
HoldToInteractboolean?Fire callback on hold rather than on tap.
Callbackfunction(Enum.KeyCode)Called when the bound key is activated.

ColorPicker #colorpicker

An HSV colour picker with RGB and hex display. Returns a control with :Set(Color3).

lua
local myPicker = Tab:CreateColorPicker({
    Name = "Highlight Color",
    Color = Color3.fromRGB(124, 58, 237),
    Callback = function(color)
        print("R:", color.R, "G:", color.G, "B:", color.B)
    end,
})

myPicker:Set(Color3.fromRGB(59, 130, 246))
PropertyTypeDescription
NamestringPicker label.
ColorColor3Default colour.
Callbackfunction(Color3)Called with the new Color3 on change.

Label #label

Static informational text. Returns a control with :Set(string) to update it later.

lua
local myLabel = Tab:CreateLabel("Status: Idle")

myLabel:Set("Status: Running")
ParameterTypeDescription
textstringText content of the label.
colorColor3?Optional text colour override.

Section #section

A visual divider with a header, used to group related elements within a tab.

lua
Tab:CreateSection("Movement")

Divider #divider

A thin horizontal line used to visually separate content areas within a tab.

lua
Tab:CreateDivider()

Paragraph #paragraph

A two-line text block with a bold title and a smaller description body. Useful for instructions, changelogs, or status displays.

lua
local info = Tab:CreateParagraph({
    Title = "About",
    Content = "RazLib is a free, open-source UI library for Roblox.",
})

-- update later
info:Set("Updated Title", "New body text.")
ParameterTypeDescription
TitlestringBold heading text.
ContentstringSmaller body text, wraps automatically.

Flag System #flags

All stateful elements accept an optional Flag string. When set, the element's current value is mirrored at RazLib.Flags["FlagName"].Value and globally at getgenv().RazLibFlags["FlagName"].Value.

lua
local godMode = Tab:CreateToggle({
    Name = "God Mode",
    Flag = "GodMode",
    CurrentValue = false,
    Callback = function(v) end,
})

-- read anywhere in your script:
print(RazLib.Flags.GodMode.Value)  -- false

godMode:Set(true)
print(RazLib.Flags.GodMode.Value)  -- true

-- also available globally:
print(getgenv().RazLibFlags.GodMode.Value)

Supported elements: Toggle, Slider, Input, Dropdown, Keybind, ColorPicker.

Notify #notify

Displays a slide-in toast notification. Pass Type for a colour-coded accent bar — the returned object has a :Dismiss() method for early dismissal.

lua
-- Types: "success"  "error"  "warning"  "info"
local notif = RazLib:Notify({
    Title    = "Loaded",
    Content  = "Script is ready.",
    Duration = 4,
    Type     = "success",
})

notif:Dismiss()  -- dismiss early
PropertyTypeDescription
TitlestringBold header text.
ContentstringBody text of the notification.
Durationnumber?Seconds before auto-dismiss.
Typestring?"success" · "error" · "warning" · "info" — sets accent colour.

Watermark #watermark

A small draggable floating label — useful for script hubs to show the script name or status. Returns a control with :Set(), :SetVisible(), and :Destroy().

lua
local wm = RazLib:SetWatermark({
    Text    = "MyScript | v1.0",
    Enabled = true,
})

wm:Set("MyScript | v1.2")   -- update text
wm:SetVisible(false)         -- hide
wm:Destroy()                 -- remove entirely
PropertyTypeDescription
TextstringLabel text displayed in the watermark.
Enabledboolean?Whether the watermark is visible on creation. Default true.
ColorColor3?Text colour. Defaults to the current theme's text colour.

Prompt #prompt

A modal confirmation dialog. The callback receives true if the user confirms before the timer expires.

lua
RazLib:Prompt({
    Title = "Confirm Action",
    Content = "This will reset your stats. Are you sure?",
    Duration = 10,
    Callback = function(confirmed)
        if confirmed then
            print("User confirmed.")
        end
    end,
})
PropertyTypeDescription
TitlestringDialog title.
ContentstringBody text asking the user a question.
DurationnumberSeconds until auto-deny.
Callbackfunction(bool)Called with true on confirm, false on deny or timeout.

Theming #theming

Pass a theme name string to Theme in CreateWindow, or call Window:SetTheme() at any time to switch themes live.

lua
Window:SetTheme("Ocean")

Window:SetTheme({
    Background = Color3.fromRGB(10, 0, 20),
    TextColor = Color3.fromRGB(255, 255, 255),
})

Built-in Themes

Default
Ocean
AmberGlow
Light
Amethyst
Green
Bloom
DarkBlue
Serenity

Custom Theme Shape

Pass a partial or full table to SetTheme(). Any missing keys fall back to the Default theme.

lua
Window:SetTheme({
    TextColor                     = Color3.fromRGB(255, 255, 255),
    Background                    = Color3.fromRGB(10, 0, 20),
    Topbar                        = Color3.fromRGB(20, 5, 35),
    Shadow                        = Color3.fromRGB(0, 0, 0),
    ElementBackground             = Color3.fromRGB(25, 10, 45),
    ElementBackgroundHover        = Color3.fromRGB(35, 15, 60),
    ToggleEnabled                 = Color3.fromRGB(124, 58, 237),
    ToggleDisabled                = Color3.fromRGB(50, 30, 80),
    SliderProgress                = Color3.fromRGB(124, 58, 237),
})

Configuration #configuration

When enabled, RazLib writes element values to a .ini file on disk and restores them on the next load. All stateful elements (toggles, sliders, inputs, dropdowns, keybinds, colour pickers) are saved automatically.

lua
local Window = RazLib:CreateWindow({
    Name = "My Script",
    ConfigurationSaving = {
        Enabled = true,
        FolderName = "RazLib",
        FileName = tostring(game.PlaceId),
    },
})
PropertyTypeDescription
EnabledbooleanMust be true to activate config saving.
FolderNamestringRoot folder created in the executor's workspace directory.
FileNamestringName of the .ini file (without extension). Using game.PlaceId gives each game its own config.
Note: The config file is written as FolderName/FileName.ini in the executor's file system. Make sure the executor you target has writefile support.

Key System #keysystem

Enables a key gate before the window opens. The user must enter a valid key. Optionally the library can save the key so it doesn't need to be entered again.

lua
local Window = RazLib:CreateWindow({
    Name = "My Script",
    KeySystem = true,
    KeySettings = {
        Title = "Key System",
        Subtitle = "Enter your key to continue",
        Note = "Keys available at discord.gg/yourserver",
        FileName = "MyScriptKey",
        SaveKey = true,
        GrabKeyFromSite = false,
        Key = {"ABC-123", "XYZ-456"},
    },
})
PropertyTypeDescription
TitlestringHeading shown on the key prompt screen.
SubtitlestringSub-heading below the title.
NotestringSmall hint text — typically where to get a key.
FileNamestringFile name used to persist a saved key.
SaveKeybooleanWrite the entered key to disk so it's auto-filled next time.
GrabKeyFromSitebooleanWhen true, a "Get Key" button links to an external page.
Keystring[]Array of accepted key strings. Any match is valid.