Your first project
Make a native window with a button that changes its text. By the end, you will know the everyday edit → check → run loop.
1. Get your tools ready
Section titled “1. Get your tools ready”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.
- Open the LUI preview release and download
LUI-SDK-Windows-x64-0.1.0-preview.2.zip. - Extract the whole ZIP to a folder you want to keep. Keep every subfolder inside
LUI-SDK-0.1.0-preview.2together. - 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. - Run LUI: Choose SDK and select the
LUI-SDK-0.1.0-preview.2folder containingSdkManifest.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.
2. Create your project
Section titled “2. Create your project”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.jsonSrc/Main.luauis your app’s entry file.lui.jsondescribes its sources and settings.LuiToolchain.jsonremembers the exact SDK version and inventory. Keep this file with your project.
3. Open a window
Section titled “3. Open a window”Replace the starter in Src/Main.luau with:
local Window = Instance.new("Window", { Title = "Hello, LUI", Size = UDim2.fromOffset(520, 320),})Window.Visible = trueInstance.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.
4. Add a button
Section titled “4. Add a button”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 = trueParent = 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.
5. Respond to a click
Section titled “5. Respond to a click”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 = trueActivated 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.
6. Make a change and return later
Section titled “6. Make a change and return later”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.
If something goes wrong
Section titled “If something goes wrong”- 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.