Skip to content

Window

Creates the app window and hosts the rendered root view.

<Window ... />

Overview

This component is backed by the platform control or container. Prefer its XML tag in an .etlua template; keep view-tree construction out of controllers.

Topics

Properties

Name Type Required Description
appearance string optional Window appearance: system, light, or dark.
commands table optional Application menu bar from <Commands> (SwiftUI .commands): appName, CommandGroup edits, CommandMenu menus and Help search topics.
content value optional Rendered child content or the control’s text value.
contentAccessory table optional Accessory view attached to the window content area.
detail table optional Rendered detail pane view.
detailWidth number optional Requested width of the detail pane, in points.
contentWidth number optional Width of the content column between the sidebar and a flexible detail pane, in points.
height number optional Component-specific setting passed to the native control.
hideTitle boolean optional Component-specific setting passed to the native control.
minHeight number optional Component-specific setting passed to the native control.
minWidth number optional Component-specific setting passed to the native control.
sidebar table optional Rendered navigation sidebar view.
sidebarWidth number optional Component-specific setting passed to the native control.
subtitle string optional Secondary window title (SwiftUI .navigationSubtitle); assign window.subtitle to update it.
size number optional Component-specific setting passed to the native control.
tabbingIdentifier string optional Identifier used to group tabbing windows.
tabbingMode string optional Window tabbing mode.
title value optional Component-specific setting passed to the native control.
toolbar table optional Toolbar item descriptors.
level string optional floating keeps the window above others and on every Space (SwiftUI .windowLevel(.floating)), as a Picture in Picture or mini player window.
aspectRatio number optional Content width over height kept while the user resizes.
onClose function optional Called when the window closes.
onBack function optional The mouse's back button or a swipe right navigates back.
onForward function optional The mouse's forward button or a swipe left navigates forward.
toolbarContentDividerAfter value optional Toolbar item identifier after which the content divider appears.
toolbarLabels boolean optional Component-specific setting passed to the native control.
transparentTitlebar boolean optional Uses a transparent title bar when true.
visible boolean optional Component-specific setting passed to the native control.
width number optional Component-specific setting passed to the native control.

Example

<Window title="Example" />

Platform notes

  • AppKit uses the AppKit implementation. UIKit uses the UIKit implementation.

Source: lua/embedded/AppKit.lua:134 (AppKit.Window)