Skip to content

SwiftUI

Import SwiftUI controls from @quickgui/solid/swift-ui and wrap them in Host. Ordinary QuickGUI components work without this.

#Host

import { Host, Button } from "@quickgui/solid/swift-ui";

<Host matchContents>
  <Button label="Continue" />
</Host>

The host is the native view boundary and can size itself from its content.

#Native controls

Buttons, labels, toggles, sliders, steppers, progress views, gauges, text and secure fields, pickers, segmented controls, date and color pickers, and popovers. They look and behave like the system controls.

#Controlled values

import { Host, Toggle } from "@quickgui/solid/swift-ui";

<Host matchContents>
  <Toggle label="Notifications" isOn={enabled()} onIsOnChange={setEnabled} />
</Host>

#Sizing

matchContents sizes the host from the control. Per-axis options are available when you need a fixed width and an intrinsic height.

#Platform support

SwiftUI hosting requires macOS. Optional appearances such as Liquid Glass depend on the operating-system version.