Toggle
A controlled native SwiftUI on/off switch.
#Import
Import Toggle from @quickgui/solid/swift-ui.
import { Host, Toggle } from "@quickgui/solid/swift-ui";#Usage
<Host matchContents>
<Toggle
label="Notifications"
isOn={notifications()}
onIsOnChange={setNotifications}
/>
</Host>#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
Toggle
View sourceToggle(props: ToggleProps): NativeNodetestIDstring—
modifiersViewModifier[]—
isOnboolean—
labelstring—
onIsOnChange(isOn: boolean, event: QuickGuiEvent) => void—
Declares onIsOnChange (optional). Reactive JSX expressions update this property in place.
(isOn: boolean, event: QuickGuiEvent) => voidView sourceref((node: NativeNode) => void) | NativeNode—
Declares ref (optional). Reactive JSX expressions update this property in place.
((node: NativeNode) => void) | NativeNodeView source