{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "select", "type": "registry:ui", "title": "Select", "description": "Styled native select for a one-of-n choice with more options than a segmented control can show.", "categories": [ "forms" ], "registryDependencies": [ "https://whiskeyjack.net/r/utils.json" ], "files": [ { "path": "components/ui/select.tsx", "type": "registry:ui", "target": "components/ui/select.tsx", "content": "import * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps\n extends Omit<\n React.SelectHTMLAttributes,\n \"onChange\" | \"value\" | \"children\"\n > {\n /** Optional label shown above the select. */\n label?: React.ReactNode;\n value: string;\n onChange: (value: string) => void;\n options: SelectOption[];\n placeholder?: string;\n}\n\n/**\n * Native `\n {/* Caret -- logical end so it sits opposite the text in RTL too */}\n \n \n \n \n \n );\n },\n);\nSelect.displayName = \"Select\";\n\nexport { Select };\n" } ], "docs": "Give it a label, value, onChange, and an options array. It stays the native control underneath, so it is accessible and familiar on every platform. For a small set of choices, ToggleGroup reads better.", "meta": { "group": "forms", "related": [ "toggle-group", "input" ], "exports": [ "Select" ], "siteSlug": "select" } }