{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "select",
"title": "Select",
"description": "A dropdown control for selecting one or more options from a list.",
"dependencies": [
"@base-ui/react",
"lucide-react"
],
"files": [
{
"path": "packages/ui/src/select.tsx",
"content": "\"use client\";\n\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport {\n Check as CheckIcon,\n ChevronDown as ChevronDownIcon,\n ChevronUp as ChevronUpIcon,\n} from \"lucide-react\";\nimport type * as React from \"react\";\nimport { cn, POPUP_ITEM_HEIGHT } from \"./utils\";\n\n// =============================================================================\n// Select (Root)\n// =============================================================================\nconst Select = SelectPrimitive.Root;\n\n// =============================================================================\n// SelectGroup\n// =============================================================================\nexport interface SelectGroupProps extends SelectPrimitive.Group.Props {}\n\nfunction SelectGroup({ className, ...props }: SelectGroupProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// SelectValue\n// =============================================================================\nexport interface SelectValueProps extends SelectPrimitive.Value.Props {}\n\nfunction SelectValue({ className, ...props }: SelectValueProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// SelectTrigger\n// =============================================================================\nexport interface SelectTriggerProps extends SelectPrimitive.Trigger.Props {\n /**\n * Size variant of the trigger\n * @default \"default\"\n */\n size?: \"sm\" | \"default\";\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: SelectTriggerProps) {\n return (\n \n {children}\n \n }\n />\n \n );\n}\n\n// =============================================================================\n// SelectContent\n// =============================================================================\nexport interface SelectContentProps extends SelectPrimitive.Popup.Props {\n /**\n * Alignment of the content\n * @default \"center\"\n */\n align?: \"start\" | \"center\" | \"end\";\n /**\n * Whether to align the selected item with the trigger\n * @default false\n */\n alignItemWithTrigger?: boolean;\n /**\n * Offset along the alignment axis\n * @default 0\n */\n alignOffset?: number;\n /**\n * Side of the trigger to position the popup\n * @default \"bottom\"\n */\n side?: \"top\" | \"bottom\" | \"left\" | \"right\" | \"inline-start\" | \"inline-end\";\n /**\n * Offset from the trigger\n * @default 4\n */\n sideOffset?: number;\n /**\n * Size of the menu items\n * @default \"default\"\n */\n size?: \"default\" | \"compact\";\n}\n\nfunction SelectContent({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = false,\n size = \"default\",\n ...props\n}: SelectContentProps) {\n return (\n \n \n \n \n \n {children}\n \n \n \n \n \n );\n}\n\n// =============================================================================\n// SelectLabel\n// =============================================================================\nexport interface SelectLabelProps extends SelectPrimitive.GroupLabel.Props {}\n\nfunction SelectLabel({ className, ...props }: SelectLabelProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// SelectItem\n// =============================================================================\nexport interface SelectItemProps extends SelectPrimitive.Item.Props {\n children: React.ReactNode;\n /**\n * Custom indicator to show when item is selected.\n * Set to `null` to hide the indicator.\n * @default \n */\n indicator?: React.ReactNode;\n}\n\nfunction SelectItem({\n className,\n children,\n indicator,\n ...props\n}: SelectItemProps) {\n const showDefaultIndicator = indicator === undefined;\n const showCustomIndicator = indicator !== undefined && indicator !== null;\n\n return (\n \n {showCustomIndicator && (\n }\n >\n {indicator}\n \n )}\n \n {children}\n \n {showDefaultIndicator && (\n \n }\n >\n \n \n )}\n \n );\n}\n\n// =============================================================================\n// SelectSeparator\n// =============================================================================\nexport interface SelectSeparatorProps extends SelectPrimitive.Separator.Props {}\n\nfunction SelectSeparator({ className, ...props }: SelectSeparatorProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// SelectScrollUpButton\n// =============================================================================\nexport interface SelectScrollUpButtonProps\n extends React.ComponentProps {}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: SelectScrollUpButtonProps) {\n return (\n \n \n \n );\n}\n\n// =============================================================================\n// SelectScrollDownButton\n// =============================================================================\nexport interface SelectScrollDownButtonProps\n extends React.ComponentProps {}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: SelectScrollDownButtonProps) {\n return (\n \n \n \n );\n}\n\nexport type { SelectRootProps as SelectProps } from \"@base-ui/react/select\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n",
"type": "registry:ui"
}
],
"type": "registry:ui"
}