This document explores the potential API for NSWindow
management in react-native-macos.
<Window>
{/* content goes here */}
</Window>
Nesting <Window>
components is forbidden.
style: StyleProp<ViewStyle>
title: string
titleBarStyle: "default" | "overlay" | "none"
closable: boolean
minimizable: boolean
resizable: boolean
borderless: boolean
alwaysOnTop: boolean
canBecomeKey: boolean
canBecomeMain: boolean
onBecomeKey: () => void
onResignKey: () => void
onBecomeMain: () => void
onResignMain: () => void
onLayout: ({ nativeEvent: { x: number, y: number, width: number, height: number } }) => void
onMinimize: () => void
onMaximize: () => void
The useWindow
hook returns the <Window>
instance that the caller is contained by.
const window = useWindow()
focus(): void
close(): void
minimize(): void
maximize(): void
The Window.open()
static method lets you open a window programatically.
Window.open(() => <Window />)