Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Multi-Window

Perry supports creating multiple native windows in a single application.

Creating Windows

import { App, Window, Text, Button, VStack } from "perry/ui";

App("Multi-Window App", () =>
  VStack([
    Text("Main Window"),
    Button("Open New Window", () => {
      Window("Second Window", () =>
        VStack([
          Text("This is a second window"),
          Button("Close", () => {
            // Close this window
          }),
        ])
      );
    }),
  ])
);

Window(title, renderFn) creates a new native window with its own widget tree.

Platform Notes

PlatformImplementation
macOSNSWindow
WindowsCreateWindowEx
LinuxGtkWindow
WebFloating <div>
iOS/AndroidModal view controller / Dialog

On mobile platforms, “windows” are presented as modal views or dialogs since mobile apps typically use a single-window model.

Next Steps