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.
local RazLib = loadstring(game:HttpGet("https://razzles.xyz/RazLib"))()
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.
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.
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"},
},
})
| Property | Type | Description |
|---|---|---|
Name | string | Window title shown in the topbar. |
LoadingTitle | string | Large text on the loading screen. |
LoadingSubtitle | string | Smaller sub-text below the loading title. |
Theme | string | table | Theme name string or a custom theme table. Defaults to "Default". |
Icon | number | Asset ID for the topbar icon. Pass 0 to hide. |
ToggleKeybind | Enum.KeyCode | Key that shows/hides the window. |
ShowText | string | Label on the mobile show button. |
Discord.Enabled | boolean | Show a Discord prompt on first load. |
Discord.Invite | string | discord.gg code only — not the full URL. |
Discord.RememberJoins | boolean | Don'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.
local Tab = Window:CreateTab("Combat", "⚔️")
| Parameter | Type | Description |
|---|---|---|
name | string | Tab label shown in the tab bar. |
icon | string? | 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.
Tab:CreateButton({
Name = "Teleport",
Description = "Teleport to the spawn point.",
Callback = function()
-- action here
end,
})
| Property | Type | Description |
|---|---|---|
Name | string | Button label. |
Description | string? | Secondary text shown below the name. |
Callback | function | Called when the button is clicked. |
Toggle #toggle
A boolean switch. Returns a control with :Set(bool).
local myToggle = Tab:CreateToggle({
Name = "Speed Boost",
CurrentValue = false,
Callback = function(value)
print("Toggled:", value)
end,
})
myToggle:Set(true)
| Property | Type | Description |
|---|---|---|
Name | string | Toggle label. |
CurrentValue | boolean | Default state on creation. |
Risky | boolean? | Adds a red border to warn the user this action is dangerous. |
Flag | string? | Key in RazLib.Flags. |
Callback | function(bool) | Called with the new boolean value on change. |
Slider #slider
A draggable value picker. Returns a control with :Set(number).
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)
| Property | Type | Description |
|---|---|---|
Name | string | Slider label. |
Range | {number, number} | Minimum and maximum values. |
Increment | number | Step size between values. |
CurrentValue | number | Starting value. |
Suffix | string? | Unit label appended to the displayed number. |
Callback | function(number) | Called with the new value on change. |
Input #input
An inline text field. Returns a control with :Set(string).
local myInput = Tab:CreateInput({
Name = "Player Name",
PlaceholderText = "Enter a username...",
CurrentValue = "",
Callback = function(value)
print("Input:", value)
end,
})
myInput:Set("Razzles")
| Property | Type | Description |
|---|---|---|
Name | string | Field label. |
PlaceholderText | string | Grey hint shown when the field is empty. |
CurrentValue | string | Pre-filled value. |
Callback | function(string) | Called with the text on enter/focus-lost. |
Dropdown #dropdown
A collapsible list for picking one or more options. Returns a control with :Set() and :Refresh().
local myDropdown = Tab:CreateDropdown({
Name = "Game Mode",
Options = {"Casual", "Ranked", "Custom"},
CurrentOption = {"Casual"},
MultipleOptions = false,
Callback = function(selected)
print("Selected:", selected[1])
end,
})
myDropdown:Set({"Ranked"})
myDropdown:Refresh({"Casual", "Ranked", "Custom", "Tournament"})
| Property | Type | Description |
|---|---|---|
Name | string | Dropdown label. |
Options | string[] | List of option strings. |
CurrentOption | string[] | Default selection — array even for single-select. |
MultipleOptions | boolean? | Allow selecting multiple options at once. |
Callback | function(string[]) | Called with the current selection array on change. |
Methods
| Method | Description |
|---|---|
:Set(options: string[]) | Programmatically set the selected options. |
:Refresh(options: string[]) | Replace the entire options list with a new one. |
Keybind #keybind
Captures a key press from the user. Returns a control with :Set(Enum.KeyCode).
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)
| Property | Type | Description |
|---|---|---|
Name | string | Keybind label. |
CurrentKeybind | Enum.KeyCode | Default key. |
HoldToInteract | boolean? | Fire callback on hold rather than on tap. |
Callback | function(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).
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))
| Property | Type | Description |
|---|---|---|
Name | string | Picker label. |
Color | Color3 | Default colour. |
Callback | function(Color3) | Called with the new Color3 on change. |
Label #label
Static informational text. Returns a control with :Set(string) to update it later.
local myLabel = Tab:CreateLabel("Status: Idle")
myLabel:Set("Status: Running")
| Parameter | Type | Description |
|---|---|---|
text | string | Text content of the label. |
color | Color3? | Optional text colour override. |
Section #section
A visual divider with a header, used to group related elements within a tab.
Tab:CreateSection("Movement")
Divider #divider
A thin horizontal line used to visually separate content areas within a tab.
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.
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.")
| Parameter | Type | Description |
|---|---|---|
Title | string | Bold heading text. |
Content | string | Smaller 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.
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.
-- Types: "success" "error" "warning" "info"
local notif = RazLib:Notify({
Title = "Loaded",
Content = "Script is ready.",
Duration = 4,
Type = "success",
})
notif:Dismiss() -- dismiss early
| Property | Type | Description |
|---|---|---|
Title | string | Bold header text. |
Content | string | Body text of the notification. |
Duration | number? | Seconds before auto-dismiss. |
Type | string? | "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().
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
| Property | Type | Description |
|---|---|---|
Text | string | Label text displayed in the watermark. |
Enabled | boolean? | Whether the watermark is visible on creation. Default true. |
Color | Color3? | 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.
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,
})
| Property | Type | Description |
|---|---|---|
Title | string | Dialog title. |
Content | string | Body text asking the user a question. |
Duration | number | Seconds until auto-deny. |
Callback | function(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.
Window:SetTheme("Ocean")
Window:SetTheme({
Background = Color3.fromRGB(10, 0, 20),
TextColor = Color3.fromRGB(255, 255, 255),
})
Built-in Themes
Custom Theme Shape
Pass a partial or full table to SetTheme(). Any missing keys fall back to the Default theme.
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.
local Window = RazLib:CreateWindow({
Name = "My Script",
ConfigurationSaving = {
Enabled = true,
FolderName = "RazLib",
FileName = tostring(game.PlaceId),
},
})
| Property | Type | Description |
|---|---|---|
Enabled | boolean | Must be true to activate config saving. |
FolderName | string | Root folder created in the executor's workspace directory. |
FileName | string | Name of the .ini file (without extension). Using game.PlaceId gives each game its own config. |
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.
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"},
},
})
| Property | Type | Description |
|---|---|---|
Title | string | Heading shown on the key prompt screen. |
Subtitle | string | Sub-heading below the title. |
Note | string | Small hint text — typically where to get a key. |
FileName | string | File name used to persist a saved key. |
SaveKey | boolean | Write the entered key to disk so it's auto-filled next time. |
GrabKeyFromSite | boolean | When true, a "Get Key" button links to an external page. |
Key | string[] | Array of accepted key strings. Any match is valid. |