Components
Complete reference for all NexusUI components with examples and options.
Window
The main container for your UI. Create a window first, then add tabs and elements.
local Window = NexusUI:CreateWindow({
Title = "My Script Hub",
SubTitle = "v1.0",
Theme = "Dark",
MinimizeKey = Enum.KeyCode.RightControl,
Size = UDim2.new(0, 500, 0, 350),
LogoId = "rbxassetid://123456789",
Acrylic = true
})Window Methods
Window:Minimize() -- Minimize the window
Window:Maximize() -- Restore the window
Window:Toggle() -- Toggle visibility
Window:Destroy() -- Destroy the window
Window:SetTheme("Cyberpunk") -- Change themeTab
Tabs organize your UI into different sections. Each tab can contain sections and elements.
local MainTab = Window:AddTab({
Title = "Main",
Icon = "home", -- Lucide icon name
Visible = true -- Show/hide tab
})Common Icons
Use any Lucide icon name: home, settings, user, shield, crosshair, eye, star, zap, etc.
Section
Sections group related elements within a tab.
local Section = MainTab:AddSection("Feature Settings")
-- Add elements to section
Section:AddToggle({ ... })
Section:AddButton({ ... })Button
Buttons trigger actions when clicked.
MainTab:AddButton({
Title = "Click Me",
Description = "Optional description",
Icon = "play", -- Optional icon
Callback = function()
print("Button clicked!")
end
})MainTab:AddButton({
Title = "Dangerous Action",
Description = "Double-click to confirm",
DoubleClick = true,
Callback = function()
print("Confirmed!")
end
})Toggle
Toggles allow users to switch features on/off.
local MyToggle = MainTab:AddToggle({
Title = "Enable Feature",
Description = "Description of the feature",
Default = false,
Flag = "MyToggleFlag", -- For config saving
Callback = function(Value)
print("Toggled: " .. tostring(Value))
end
})Toggle Methods
MyToggle:Set(true) -- Set toggle value
MyToggle:GetValue() -- Get current value
MyToggle:Lock() -- Disable toggle
MyToggle:Unlock() -- Enable toggleSlider
Sliders allow users to select a number within a range.
local MySlider = MainTab:AddSlider({
Title = "Walk Speed",
Description = "Adjust player speed",
Min = 16,
Max = 100,
Default = 16,
Increment = 1, -- Step size
Suffix = " studs/s", -- Display suffix
Flag = "SpeedSlider",
Callback = function(Value)
local player = game.Players.LocalPlayer
if player.Character then
player.Character.Humanoid.WalkSpeed = Value
end
end
})Slider Methods
MySlider:Set(50) -- Set slider value
MySlider:GetValue() -- Get current value
MySlider:Lock() -- Disable slider
MySlider:Unlock() -- Enable sliderDropdown
Dropdowns let users select from a list of options.
local MyDropdown = MainTab:AddDropdown({
Title = "Select Target",
Description = "Choose a target part",
Values = {"Head", "Torso", "HumanoidRootPart"},
Default = "Head",
Placeholder = "Select...",
Flag = "TargetDropdown",
Callback = function(Value)
print("Selected: " .. Value)
end
})local MultiDropdown = MainTab:AddDropdown({
Title = "Select Features",
Values = {"ESP", "Aimbot", "Speed", "Fly"},
Default = {"ESP"},
Multi = true, -- Enable multi-select
Flag = "FeaturesDropdown",
Callback = function(Value)
for feature, enabled in pairs(Value) do
print(feature .. ": " .. tostring(enabled))
end
end
})Dropdown Methods
MyDropdown:Set("Torso") -- Set value
MyDropdown:SetValues({"A", "B", "C"}) -- Update options
MyDropdown:GetValue() -- Get current valueInput
Text inputs allow users to enter text.
local MyInput = MainTab:AddInput({
Title = "Player Name",
Description = "Enter player to teleport to",
Placeholder = "Type name...",
Default = "",
MaxLength = 50,
Flag = "PlayerInput",
Finished = true, -- Callback on Enter/FocusLost
Callback = function(Value)
print("Entered: " .. Value)
end
})MainTab:AddInput({
Title = "Amount",
Placeholder = "Enter number",
Numeric = true, -- Only allow numbers
Callback = function(Value)
print("Number: " .. tonumber(Value))
end
})Keybind
Keybinds let users bind keyboard shortcuts to actions.
local MyKeybind = MainTab:AddKeybind({
Title = "Toggle Feature",
Description = "Press to toggle",
Default = Enum.KeyCode.X,
Mode = "Toggle", -- "Toggle", "Hold", or "Always"
Flag = "FeatureKey",
Callback = function(IsEnabled)
print("Feature: " .. tostring(IsEnabled))
end
})MainTab:AddKeybind({
Title = "Hold to Sprint",
Default = Enum.KeyCode.LeftShift,
Mode = "Hold",
Callback = function(IsHolding)
local player = game.Players.LocalPlayer
if player.Character then
player.Character.Humanoid.WalkSpeed = IsHolding and 50 or 16
end
end
})ColorPicker
Color pickers allow users to select colors.
local MyColor = MainTab:AddColorPicker({
Title = "ESP Color",
Description = "Choose highlight color",
Default = Color3.fromRGB(255, 0, 0),
Transparency = 0, -- Optional transparency slider
Flag = "ESPColor",
Callback = function(Color)
print("Color: " .. tostring(Color))
end,
TransparencyCallback = function(Transparency)
print("Transparency: " .. Transparency)
end
})ColorPicker Methods
MyColor:Set(Color3.fromRGB(0, 255, 0))
MyColor:GetColor()
MyColor:SetTransparency(0.5)Paragraph
Paragraphs display static text content.
MainTab:AddParagraph({
Title = "Welcome!",
Content = [[This is a multi-line paragraph.
You can add any text here:
• Instructions
• Changelog
• Credits
• Warnings]]
})Divider
Add visual separation between elements.
MainTab:AddDivider()