本文へスキップ

Button

テキスト、SF Symbol、セマンティックロール、押下処理に対応したネイティブ SwiftUI Button です。

#インポート

@quickgui/solid/swift-ui から Button をインポートします。

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

#使い方

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

#API リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

Button(props: ButtonProps): NativeNode
testIDstring—

Stable identifier exposed to macOS accessibility and UI testing.

string
ソースを見る
modifiersViewModifier[]—

SwiftUI modifiers, applied in array order.

ViewModifier[]
ソースを見る
labelstring—

The text label for a simple button.

string
ソースを見る
systemImagestring—

An SF Symbols name shown beside `label`.

string
ソースを見る
roleButtonRole—

Semantic SwiftUI button role.

ButtonRole
ソースを見る
onPress(event: QuickGuiEvent) => void—

Called when the native SwiftUI button is pressed.

(event: QuickGuiEvent) => void
ソースを見る
targetstring—

Identifier reserved for widget and live-activity button targets.

string
ソースを見る
childrenunknown—

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

unknown
ソースを見る
ref((node: NativeNode) => void) | NativeNode—

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

((node: NativeNode) => void) | NativeNode
ソースを見る