本文へスキップ

Picker

メニュー、セグメント、ラジオグループ、インラインの各スタイルに対応した、制御された SwiftUI Picker です。

#インポート

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

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

#使い方

<Host matchContents>
  <Picker
    label="Theme"
    selection={theme()}
    options={[
      { value: "system", label: "System" },
      { value: "light", label: "Light" },
      { value: "dark", label: "Dark" },
    ]}
    style="menu"
    onSelectionChange={setTheme}
  />
</Host>

#API リファレンス

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

Picker(props: PickerProps): NativeNode
testIDstring—

Stable identifier exposed to macOS accessibility and UI testing.

string
ソースを見る
modifiersViewModifier[]—

SwiftUI modifiers, applied in array order.

ViewModifier[]
ソースを見る
selectionstring—

Controlled selected option value.

string
ソースを見る
optionsreadonly PickerOption[]—

Declares options. Reactive JSX expressions update this property in place.

readonly PickerOption[]
ソースを見る
labelstring—

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

string
ソースを見る
stylePickerStyle—

Layout, typography, paint, and interaction-state styles. Arrays merge left to right.

PickerStyle
ソースを見る
onSelectionChange(selection: string, event: QuickGuiEvent) => void—

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

(selection: string, event: QuickGuiEvent) => void
ソースを見る
ref((node: NativeNode) => void) | NativeNode—

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

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