Skip to content

Button

A native SwiftUI button with text, SF Symbol, semantic role, and press handling.

#Import

Import Button from @quickgui/solid/swift-ui.

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

#Usage

<Host matchContents>
  <Button
    label="Continue"
    systemImage="arrow.right"
    onPress={continueFlow}
  />
</Host>

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

Button(props: ButtonProps): NativeNode
testIDstring—

Stable identifier exposed to macOS accessibility and UI testing.

string
View source
modifiersViewModifier[]—

SwiftUI modifiers, applied in array order.

ViewModifier[]
View source
labelstring—

The text label for a simple button.

string
View source
systemImagestring—

An SF Symbols name shown beside `label`.

string
View source
roleButtonRole—

Semantic SwiftUI button role.

ButtonRole
View source
onPress(event: QuickGuiEvent) => void—

Called when the native SwiftUI button is pressed.

(event: QuickGuiEvent) => void
View source
targetstring—

Identifier reserved for widget and live-activity button targets.

string
View source
childrenunknown—

Optional nested text used as the label when `label` is omitted.

unknown
View source
ref((node: NativeNode) => void) | NativeNode—

Declares ref (optional). Reactive JSX expressions update this property in place.

((node: NativeNode) => void) | NativeNode
View source