Skip to content

Search documentation

Enter at least two characters.

    Your first project

    SDK 0.1.0-preview.2 · ExperimentalDownload & release notes ↗

    Make a native window with a button that changes its text. By the end, you will know the everyday edit → check → run loop.

    You need a Windows 64-bit PC and VS Code. This tutorial uses SDK 0.1.0-preview.2. It is an early, unsigned preview; first-time setup on a completely fresh Windows PC is still being tested.

    1. Open the LUI preview release and download LUI-SDK-Windows-x64-0.1.0-preview.2.zip.
    2. Extract the whole ZIP to a folder you want to keep. Keep every subfolder inside LUI-SDK-0.1.0-preview.2 together.
    3. In VS Code, open the Command Palette with Ctrl+Shift+P. Run Extensions: Install from VSIX and select LUI-SDK-0.1.0-preview.2/Editor/LUI.vsix.
    4. Run LUI: Choose SDK and select the LUI-SDK-0.1.0-preview.2 folder containing SdkManifest.json.

    Windows may display a warning because the preview is unsigned. Only run a download whose source you trust. If setup fails, read the LUI Preview output in VS Code and see setup help.

    You should see: the LUI commands in VS Code. Application authors do not need the .NET SDK or a C++ compiler to use this bundle.

    Run LUI: Create Project, select an existing parent folder and enter HelloLui as the project name. Choose a new name if that folder already exists. The extension needs a trusted workspace before creating or running projects; only trust code you understand and trust.

    VS Code opens the new folder. Its important files are:

    HelloLui/
    Src/Main.luau
    lui.json
    LuiToolchain.json
    • Src/Main.luau is your app’s entry file.
    • lui.json describes its sources and settings.
    • LuiToolchain.json remembers the exact SDK version and inventory. Keep this file with your project.

    Replace the starter in Src/Main.luau with:

    local Window = Instance.new("Window", {
    Title = "Hello, LUI",
    Size = UDim2.fromOffset(520, 320),
    })
    Window.Visible = true

    Instance.new creates an object. Window is the class name, and the table supplies its starting properties. Visible initially defaults to false, so set it to true after creating the content.

    Save the file. Run LUI: Check Types, then LUI: Run App.

    You should see: an empty window titled Hello, LUI. Close it before continuing. Download this checkpoint.

    Replace Src/Main.luau with this complete version:

    local Window = Instance.new("Window", {
    Title = "Hello, LUI",
    Size = UDim2.fromOffset(520, 320),
    })
    local Button = Instance.new("TextButton", {
    Parent = Window,
    Text = "Say hello",
    Size = UDim2.fromOffset(180, 44),
    Position = UDim2.fromOffset(24, 24),
    })
    Window.Visible = true

    Parent = Window puts the button inside the window. Size and Position use logical units. UDim2.fromOffset creates an offset-only size or position.

    Save, check and run again. You should see: a Say hello button near the top-left. It has no action yet. Download this checkpoint.

    Add an event connection before showing the window. Here is the complete file:

    local Window = Instance.new("Window", {
    Title = "Hello, LUI",
    Size = UDim2.fromOffset(520, 320),
    })
    local Button = Instance.new("TextButton", {
    Parent = Window,
    Text = "Say hello",
    Size = UDim2.fromOffset(180, 44),
    Position = UDim2.fromOffset(24, 24),
    })
    Button.Activated:Connect(function()
    Button.Text = "Hello, world!"
    end)
    Window.Visible = true

    Activated is the button’s activation event. Connect registers the function that changes Button.Text.

    Save, check and run. Click Say hello. You should see: the button change to Hello, world!. Download the finished project.

    Related reference: Window, TextButton, Instance and UDim2.

    Change the greeting, save your file, use LUI: Restart App. Saving does not restart the native app automatically in this preview.

    Tomorrow, open the same project folder and run it again. If LUI asks for an SDK, use LUI: Choose SDK to select the exact version recorded in LuiToolchain.json. Do not edit the pin just to hide a mismatch.

    • No window: inspect the LUI Preview output and confirm you set Window.Visible = true.
    • Old code still running: save the files and use Restart App.
    • Type error: read the reported file/line in the Problems panel; compare against the complete checkpoint.
    • SDK missing or mismatched: keep the extracted SDK together and select the matching installation. See setup help.

    You have made your first LUI app. Next, build a project library with modules, screens and shared state.