Skip to content

Search documentation

Enter at least two characters.

    Window

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

    A top-level native window. Create its content, then set Visible to true to show it.

    Create: Instance.new("Window", {...}). Inherits: Instance.

    Parent and children: Top-level window; do not give it a Parent. It can own child content.

    Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.

    local Window = Instance.new("Window", {
    Title = "My app", Size = UDim2.fromOffset(560, 280),
    })
    Window.Visible = true

    Expected result: A window titled My app opens. Visible starts false, so the last line matters.

    Text shown in the native window title bar.

    Type: string. Default: empty string. Read/write field.

    Shows or hides the native window. Create the content first, then set this to true.

    Type: boolean. Default: false. Read/write field.

    Whether the native window has reached its closed state. This is a terminal lifetime state, not the inverse of Visible.

    Type: boolean. Default: false; terminal native lifetime. Read-only.

    Requested window size in logical units. Use an offset size for a top-level window, which has no parent viewport.

    Type: UDim2. Default: 800x600. Read/write field.

    The origin of the window’s shared layout, (0, 0). It is not the native window’s position on the desktop.

    Type: Vector2. Default: derived. Read-only.

    The resolved window size. It can differ from the size you originally requested after native resizing.

    Type: Vector2. Default: derived. Read-only.

    Requests normal window closure, including CloseRequested handlers. Returns whether the request was accepted and an optional refusal reason. It is not unconditional destruction.

    RequestClose() -> (boolean, string?)

    Refuses the current close decision when called inside CloseRequested. It returns false outside an active close decision.

    PreventClose() -> boolean

    Receives an unhandled keyboard shortcut, including modifier and text-editing flags. It is not a global hotkey and cannot capture another application’s input.

    Type: ShortcutSignal. Subscribe with :Connect(function(...) ... end).

    Fires before normal native closure. Call PreventClose here when the user needs to save edits first. No arguments are passed.

    Type: Signal. Subscribe with :Connect(function(...) ... end).

    Fires when native closure completes. No arguments are passed. Closure is distinct from Destroy: retained child Instances can still exist, so explicitly destroy the tree or reparent content when its app lifetime ends.

    Type: Signal. Subscribe with :Connect(function(...) ... end).

    You can use these directly on Window. Follow a member link for its explanation and example.

    Name · Sensitive · EffectiveSensitive · Parent · ClassName · Destroy · Clone · GetChildren · GetDescendants · FindFirstChild · IsA · Changed · Destroying

    Full type declaration — for type checking and deeper reference

    The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.

    export type Window = Instance & {
    Title: string,
    Visible: boolean,
    read IsClosed: boolean,
    Size: UDim2,
    read AbsolutePosition: Vector2,
    read AbsoluteSize: Vector2,
    read RequestClose: (Self: Window) -> (boolean, string?),
    read PreventClose: (Self: Window) -> boolean,
    read Shortcut: ShortcutSignal,
    read CloseRequested: Signal,
    read Closed: Signal,
    }

    See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.