/Praxis

UI Library Documentation

A modern, lightweight UI library for Roblox with support for toggles, buttons, sliders, inputs, and dropdowns.

Table of Contents


Installation

Load the library using the following code:

local Library = loadstring(game:HttpGet("YOUR_LIBRARY_URL_HERE"))()

Getting Started

Basic Setup

local Library = loadstring(game:HttpGet("YOUR_LIBRARY_URL_HERE"))()

local Window = Library:CreateWindow({
    Title = "My UI",
    Width = 320,
    MinHeight = 120,
    MaxHeight = 600
})

Place Restriction (Optional)

Restrict the UI to specific PlaceIds:

local Window = Library:CreateWindow({
    Title = "My UI",
    AllowedPlaces = 1234567890  -- Single PlaceId
})

-- Or multiple places:
local Window = Library:CreateWindow({
    Title = "My UI",
    AllowedPlaces = {1234567890, 9876543210}
})

If the script runs in an unauthorized place, the player will be kicked with a professional error message.


API Reference

CreateWindow

Creates a new window instance.

Parameters:

Parameter Type Default Description
Title string "UI Library" Window title displayed in header
Width number 320 Window width in pixels
MinHeight number 120 Minimum window height
MaxHeight number 600 Maximum window height before scrolling
AllowedPlaces number/table nil PlaceId(s) where UI is allowed

Example:

local Window = Library:CreateWindow({
    Title = "Training Script",
    Width = 350,
    MaxHeight = 500
})

AddToggle

Creates a toggle element with checkbox or modern switch style.

Parameters:

Parameter Type Default Description
Name string "Toggle" Display name
Default boolean false Initial state
Style string "checkbox" Style: "checkbox" or "modern"
ExclusiveGroup string nil Group name for radio-button behavior
Callback function nil Function called when toggled

Styles:

  • checkbox: Traditional checkbox with checkmark
  • modern: iOS-style switch with sliding animation

Example:

-- Checkbox style
local toggle1 = Window:AddToggle({
    Name = "Enable Feature",
    Default = false,
    Style = "checkbox",
    Callback = function(value)
        print("Feature enabled:", value)
    end
})

-- Modern switch style
local toggle2 = Window:AddToggle({
    Name = "Auto Farm",
    Default = true,
    Style = "modern",
    Callback = function(value)
        print("Auto farm:", value)
    end
})

-- Exclusive group (radio buttons)
Window:AddToggle({
    Name = "Option A",
    ExclusiveGroup = "options",
    Callback = function(value) end
})

Window:AddToggle({
    Name = "Option B",
    ExclusiveGroup = "options",
    Callback = function(value) end
})

Methods:

toggle:SetValue(true)  -- Programmatically set value

AddButton

Creates a clickable button.

Parameters:

Parameter Type Default Description
Name string "Button" Button text
Callback function nil Function called when clicked

Example:

Window:AddButton({
    Name = "Execute Action",
    Callback = function()
        print("Button clicked!")
    end
})

AddSlider

Creates a slider with adjustable value and manual input.

Parameters:

Parameter Type Default Description
Name string "Slider" Display name
Min number 0 Minimum value
Max number 100 Maximum value
Default number Min Initial value
Increment number 1 Step size for value changes
Callback function nil Function called when value changes

Features:

  • Drag the slider to adjust value
  • Click anywhere on the slider bar to jump to position
  • Type value directly into the input box
  • Animated knob indicator

Example:

local slider = Window:AddSlider({
    Name = "Walk Speed",
    Min = 16,
    Max = 100,
    Default = 16,
    Increment = 1,
    Callback = function(value)
        game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = value
    end
})

-- Programmatically set value
slider:SetValue(50)

AddInput

Creates a text input field.

Parameters:

Parameter Type Default Description
Name string "Input" Label text
Default string "" Initial text value
Placeholder string "Enter text..." Placeholder text
Callback function nil Function called on focus lost

Example:

local input = Window:AddInput({
    Name = "Player Name",
    Default = "",
    Placeholder = "Enter username...",
    Callback = function(text)
        print("Input value:", text)
    end
})

-- Programmatically set value
input:SetValue("NewUsername")

AddDropdown

Creates a dropdown menu with single or multiple selection support.

CRITICAL LIMITATION: Only ONE dropdown is allowed per window. Attempting to add more than one dropdown will result in the player being kicked from the game. This is a hard limit for optimal performance and stability.

Parameters:

Parameter Type Default Description
Name string "Dropdown" Display name
Options table {} Array of option strings
Default table {} Array of initially selected options
MaxSelections number unlimited Maximum number of selections allowed
AutoRefresh function nil Function that returns updated options
RefreshInterval number 1 Seconds between auto-refresh calls
Callback function nil Function called when selection changes

Example:

-- Single selection dropdown
local dropdown = Window:AddDropdown({
    Name = "Select Weapon",
    Options = {"Sword", "Bow", "Staff", "Axe"},
    Default = {"Sword"},
    MaxSelections = 1,
    Callback = function(selected)
        print("Selected weapon:", selected[1])
    end
})

-- Multiple selection dropdown
Window:AddDropdown({
    Name = "Select Items",
    Options = {"Item 1", "Item 2", "Item 3", "Item 4"},
    Default = {},
    MaxSelections = 3,
    Callback = function(selected)
        print("Selected items:", table.concat(selected, ", "))
    end
})

Methods:

-- Programmatically set selected values
dropdown:SetValue({"Bow", "Staff"})

-- Manually refresh options
dropdown:Refresh({"New Option 1", "New Option 2"})

Advanced Features

Auto-Refresh Dropdown

Automatically update dropdown options at regular intervals.

Example:

-- Function to get player list
local function getPlayers()
    local players = {}
    for _, player in ipairs(game.Players:GetPlayers()) do
        table.insert(players, player.Name)
    end
    return players
end

-- Dropdown that refreshes every 2 seconds
Window:AddDropdown({
    Name = "Select Player",
    Options = getPlayers(),
    MaxSelections = 1,
    AutoRefresh = getPlayers,
    RefreshInterval = 2,
    Callback = function(selected)
        print("Target player:", selected[1])
    end
})

Exclusive Toggle Groups

Create radio-button behavior where only one toggle can be active.

Example:

Window:AddToggle({
    Name = "Mode: Attack",
    ExclusiveGroup = "combat_mode",
    Callback = function(value)
        if value then print("Attack mode enabled") end
    end
})

Window:AddToggle({
    Name = "Mode: Defense",
    ExclusiveGroup = "combat_mode",
    Callback = function(value)
        if value then print("Defense mode enabled") end
    end
})

Window:AddToggle({
    Name = "Mode: Support",
    ExclusiveGroup = "combat_mode",
    Callback = function(value)
        if value then print("Support mode enabled") end
    end
})

Keyboard Toggle

Press K to show/hide the UI.


Examples

Complete Script Example

local Library = loadstring(game:HttpGet("YOUR_LIBRARY_URL_HERE"))()

-- Create window with place restriction
local Window = Library:CreateWindow({
    Title = "Training Script",
    Width = 320,
    MaxHeight = 600,
    AllowedPlaces = {1234567890, 9876543210}
})

-- Add toggles
Window:AddToggle({
    Name = "Auto Farm",
    Default = false,
    Style = "modern",
    Callback = function(value)
        _G.AutoFarm = value
        print("Auto farm:", value)
    end
})

Window:AddToggle({
    Name = "Collect Coins",
    Default = false,
    Style = "checkbox",
    Callback = function(value)
        _G.CollectCoins = value
    end
})

-- Add slider
Window:AddSlider({
    Name = "Walk Speed",
    Min = 16,
    Max = 200,
    Default = 16,
    Increment = 1,
    Callback = function(value)
        game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = value
    end
})

-- Add input
Window:AddInput({
    Name = "Custom Message",
    Placeholder = "Type message...",
    Callback = function(text)
        print("Message:", text)
    end
})

-- Add dropdown (ONLY ONE ALLOWED PER WINDOW)
Window:AddDropdown({
    Name = "Select Weapon",
    Options = {"Sword", "Bow", "Staff", "Axe", "Hammer"},
    Default = {},
    MaxSelections = 1,
    Callback = function(selected)
        if #selected > 0 then
            print("Equipped:", selected[1])
        end
    end
})

-- DO NOT add a second dropdown or player will be kicked

-- Add button
Window:AddButton({
    Name = "Teleport to Spawn",
    Callback = function()
        local player = game.Players.LocalPlayer
        if player.Character then
            player.Character:MoveTo(Vector3.new(0, 10, 0))
        end
    end
})

UI Controls

  • Drag: Click and drag the header to move the window
  • Minimize: Click "Minimize" button to collapse the window
  • Close: Click "Close" button to destroy the UI
  • Toggle UI: Press K to show/hide the entire UI
  • Dropdown: Click dropdown name to open/close menu
  • Slider: Drag slider or type value directly

Limitations

  • CRITICAL: Maximum of 1 dropdown per window - Adding more will kick the player
  • Dropdown displays maximum 8 items before scrolling
  • UI position resets on character respawn (unless ResetOnSpawn is modified)

Notes

  • All callbacks are optional and can be omitted
  • SetValue methods available for all interactive elements
  • UI automatically adjusts height based on content
  • Compatible with mobile and desktop devices
  • Font: RobotoCondensed for consistent styling

Support

For issues or feature requests, please contact the developer or open an issue in the repository.

Powered by hosted.md