UI Library Documentation
The official UI framework for all Roblox Enhanced scripts - providing a consistent, modern interface for every script published on the platform.
Overview
The Roblox Enhanced UI Library is the official UI framework for all Roblox Enhanced scripts. Every script published on our platform must use this library to ensure consistency and quality across all user interfaces. It provides a modern, sleek design with easy-to-use components for building complex user interfaces.
Getting Started
Load the library at the top of your script:
if not EnhancedUI then EnhancedUI = loadstring(game:HttpGet("https://renhanced.deitsuki.fr/uilib"))() end
Create a window:
local window = EnhancedUI.Window.new({title = "My Menu"})
Create tabs and add components:
local mainTab = window:CreateTab({name = "Main"})
local button = mainTab:CreateButton({text = "Click Me", callback = function() print("Button clicked!") end})
Window Class
The Window class represents the main UI window.
Window.new({title})
Creates a new window with the specified title.
window:CreateTab({name})
Creates a new tab in the window.
window:ChangeTab(name)
Switches to the specified tab.
window:SendNotification({text, duration})
Displays a notification message.
window:Toggle()
Toggles the visibility of the window.
window:Destroy()
Destroys the window and cleans up resources.
Tab Class
The Tab class represents a tab within a window, containing various UI components.
tab:CreateTitle({text})
Creates a title element.
tab:CreateText({text})
Creates a text element.
tab:CreateButton({text, callback})
Creates a button.
tab:CreateToggle({text, callback, default})
Creates a toggle switch.
tab:CreateInput({text, callback, default})
Creates a text input field.
tab:CreateDropdown({text, items, default, callback})
Creates a dropdown selection.
tab:CreateMultiSelect({text, items, default, callback})
Creates a multi-select dropdown.
All components expose a :Destroy() method to remove them from the UI.
Components
Detailed reference for each UI component with examples.
Button
A clickable element that fires a callback when pressed.
- SetText(newText) — Sets the button label
- SetCallback(fn) — Replaces the click handler
- Trigger() — Fires the callback programmatically
- Destroy() — Removes the button
local button = tab:CreateButton({text = "Activate", callback = function()
print("Button activated!")
end})
button:SetText("Deactivate") -- Change text later
Toggle
A switch for enabling or disabling a feature.
- Set(newValue) — Sets the toggle state
- Get() — Returns current state (boolean)
- SetText(newText) — Updates the label
- SetCallback(fn) — Replaces the change handler
- Destroy() — Removes the toggle
local toggle = tab:CreateToggle({text = "Auto Farm", default = false, callback = function(state)
if state then startFarming() else stopFarming() end
end})
print("Current state: " .. tostring(toggle:Get())) -- false
Input
A text field for user string entry.
- Set(newContent) — Sets the field value
- Get() — Returns the current text
- SetText(placeholder) — Updates the placeholder
- SetCallback(fn) — Replaces the change handler
- Destroy() — Removes the input
local input = tab:CreateInput({text = "Enter username", default = "Player123", callback = function(text)
print("Username entered: " .. text)
end})
input:Set("NewPlayer") -- Change value programmatically
Dropdown
A single-selection dropdown menu.
- Set(newItem) — Selects an item by value or index
- Get() — Returns
{value, index} - SetItems(newItems, idx) — Replaces the item list
- SetText(newText) — Updates the label
- SetCallback(fn) — Replaces the change handler
- Destroy() — Removes the dropdown
local dropdown = tab:CreateDropdown({text = "Difficulty", items = {"Easy", "Medium", "Hard"}, default = 1, callback = function(selected, index)
print("Selected: " .. selected .. " at index " .. index)
end})
dropdown:Set("Hard") -- Select "Hard"
print(dropdown:Get().value .. ", " .. dropdown:Get().index) -- Hard, 3
Multi-Select
A dropdown allowing multiple simultaneous selections.
- Set(itemText, isSelected) — Sets an item's selection state
- Get() — Returns a table of all selected items
- SetItems(newItems, selected) — Replaces the item list
- SetText(newText) — Updates the label
- SetCallback(fn) — Replaces the change handler
- Destroy() — Removes the multi-select
local multiselect = tab:CreateMultiSelect({text = "Features", items = {"Auto", "ESP", "Speed"}, default = {"ESP"}, callback = function(item, selected, allSelected)
print(item, "is now", selected and "selected" or "deselected")
print("All selected:", allSelected)
end})
local selected = multiselect:Get() -- Table of selected items
Title and Text
Display-only elements for labelling sections or showing information.
- SetText(newText) — Updates the displayed text
- Destroy() — Removes the element
local title = tab:CreateTitle({text = "Settings Panel"})
local text = tab:CreateText({text = "Adjust your preferences below."})
title:SetText("Advanced Settings") -- Update title later
Notifications
The notification system displays temporary messages in the bottom-right corner of the screen.
window:SendNotification({text = "This is a notification!", duration = 5})
Examples
Basic Window with Button
if not EnhancedUI then EnhancedUI = loadstring(game:HttpGet("https://renhanced.deitsuki.fr/uilib"))() end
local window = EnhancedUI.Window.new({title = "My Script"})
local mainTab = window:CreateTab({name = "Main"})
local clickCount = 0
local button = mainTab:CreateButton({text = "Click Me", callback = function()
clickCount = clickCount + 1
button:SetText("Clicked " .. clickCount .. " times")
end})
Toggle and Input
local toggle = mainTab:CreateToggle({text = "Enable Feature", callback = function(state)
print("Feature enabled:", state)
end, default = false})
local input = mainTab:CreateInput({text = "Enter name", callback = function(text)
print("Name entered:", text)
end, default = "Default Name"})
Dropdown Selection
local options = {"Option 1", "Option 2", "Option 3"}
local dropdown = mainTab:CreateDropdown({text = "Choose Option", items = options, default = 1, callback = function(selected, index)
print("Selected:", selected, "Index:", index)
end})
Multi-Select
local items = {"Item A", "Item B", "Item C"}
local multiselect = mainTab:CreateMultiSelect({text = "Select Items", items = items, callback = function(item, selected, allSelected)
print(item, "is now", selected and "selected" or "deselected")
end})
Notification
window:SendNotification({text = "Script loaded successfully!"})