{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"picker-swiftui","type":"registry:item","title":"Picker","description":"A SwiftUI single-choice input with native menu, segmented, wheel and navigation presentations.","files":[{"path":"snippets/picker-swiftui.tsx","content":"import { useState } from \"react\";\nimport { Host, Picker, Text } from \"@expo/ui/swift-ui\";\nimport { pickerStyle, tag } from \"@expo/ui/swift-ui/modifiers\";\n\nconst options = [\"Apple\", \"Banana\", \"Orange\"];\n\nexport default function SegmentedPickerExample() {\n  const [selectedTag, setSelectedTag] = useState(options[0]);\n\n  // Segmented and wheel pickers stretch to the width they are given, so they\n  // collapse under `matchContents`.\n  return (\n    <Host style={{ flex: 1 }}>\n      <Picker\n        modifiers={[pickerStyle(\"segmented\")]}\n        label=\"Select a fruit\"\n        selection={selectedTag}\n        onSelectionChange={(selection) => {\n          setSelectedTag(selection);\n        }}\n      >\n        {options.map((option) => (\n          <Text key={option} modifiers={[tag(option)]}>\n            {option}\n          </Text>\n        ))}\n      </Picker>\n    </Host>\n  );\n}\n","type":"registry:file","target":"~/snippets/picker-swiftui.tsx"}],"author":"expo","dependencies":["@expo/ui"]}