{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "dropdown-menu-example", "title": "Dropdown Menu", "registryDependencies": [ "avatar", "button", "dialog", "dropdown-menu", "example" ], "files": [ { "path": "registry/base-lyra/examples/dropdown-menu-example.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport {\n Example,\n ExampleWrapper,\n} from \"@/registry/bases/base/components/example\"\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"@/registry/bases/base/ui/avatar\"\nimport { Button } from \"@/registry/bases/base/ui/button\"\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/registry/bases/base/ui/dialog\"\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"@/registry/bases/base/ui/dropdown-menu\"\nimport { IconPlaceholder } from \"@/app/(create)/components/icon-placeholder\"\n\nexport default function DropdownMenuExample() {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n\nfunction DropdownMenuBasic() {\n return (\n \n \n }\n >\n Open\n \n \n \n My Account\n Profile\n Billing\n Settings\n \n \n GitHub\n Support\n API\n \n \n \n )\n}\n\nfunction DropdownMenuWithIcons() {\n return (\n \n \n }\n >\n Open\n \n \n \n \n Profile\n \n \n \n Billing\n \n \n \n Settings\n \n \n \n \n Log out\n \n \n \n \n )\n}\n\nfunction DropdownMenuWithShortcuts() {\n return (\n \n \n }\n >\n Open\n \n \n \n My Account\n \n Profile\n ⇧⌘P\n \n \n Billing\n ⌘B\n \n \n Settings\n ⌘S\n \n \n Keyboard shortcuts\n ⌘K\n \n \n \n \n Log out\n ⇧⌘Q\n \n \n \n \n )\n}\n\nfunction DropdownMenuWithSubmenu() {\n return (\n \n \n }\n >\n Open\n \n \n \n Team\n \n Invite users\n \n \n Email\n Message\n \n More...\n \n \n \n \n New Team\n ⌘+T\n \n \n \n \n \n )\n}\n\nfunction DropdownMenuWithCheckboxes() {\n const [showStatusBar, setShowStatusBar] = React.useState(true)\n const [showActivityBar, setShowActivityBar] = React.useState(false)\n const [showPanel, setShowPanel] = React.useState(false)\n\n return (\n \n \n }\n >\n Checkboxes\n \n \n \n Appearance\n \n \n Status Bar\n \n \n \n Activity Bar\n \n \n \n Panel\n \n \n \n \n \n )\n}\n\nfunction DropdownMenuWithRadio() {\n const [position, setPosition] = React.useState(\"bottom\")\n\n return (\n \n \n }\n >\n Radio Group\n \n \n \n Panel Position\n \n \n \n Top\n \n \n \n Bottom\n \n \n \n Right\n \n \n \n \n \n \n )\n}\n\nfunction DropdownMenuWithCheckboxesIcons() {\n const [notifications, setNotifications] = React.useState({\n email: true,\n sms: false,\n push: true,\n })\n\n return (\n \n \n }\n >\n Notifications\n \n \n \n Notification Preferences\n \n setNotifications({ ...notifications, email: checked === true })\n }\n >\n \n Email notifications\n \n \n setNotifications({ ...notifications, sms: checked === true })\n }\n >\n \n SMS notifications\n \n \n setNotifications({ ...notifications, push: checked === true })\n }\n >\n \n Push notifications\n \n \n \n \n \n )\n}\n\nfunction DropdownMenuWithRadioIcons() {\n const [paymentMethod, setPaymentMethod] = React.useState(\"card\")\n\n return (\n \n \n }\n >\n Payment Method\n \n \n \n Select Payment Method\n \n \n \n Credit Card\n \n \n \n PayPal\n \n \n \n Bank Transfer\n \n \n \n \n \n \n )\n}\n\nfunction DropdownMenuWithDestructive() {\n return (\n \n \n }\n >\n Actions\n \n \n \n \n Edit\n \n \n \n Share\n \n \n \n \n Archive\n \n \n \n Delete\n \n \n \n \n )\n}\n\nfunction DropdownMenuWithAvatar() {\n const menuContent = (\n <>\n \n \n \n Account\n \n \n \n Billing\n \n \n \n Notifications\n \n \n \n \n \n Sign Out\n \n >\n )\n\n return (\n \n \n \n \n }\n >\n \n \n CN\n \n \n shadcn\n \n shadcn@example.com\n \n \n \n \n \n {menuContent}\n \n \n \n \n }\n >\n \n \n LR\n \n \n \n {menuContent}\n \n \n \n \n )\n}\n\nfunction DropdownMenuInDialog() {\n return (\n \n \n }>\n Open Dialog\n \n \n \n Dropdown Menu Example\n \n Click the button below to see the dropdown menu.\n \n \n \n }\n >\n Open Menu\n \n \n \n \n Copy\n \n \n \n Cut\n \n \n \n Paste\n \n \n \n More Options\n \n \n Save Page...\n Create Shortcut...\n Name Window...\n \n Developer Tools\n \n \n \n \n \n \n Delete\n \n \n \n \n \n \n )\n}\n\nfunction DropdownMenuComplex() {\n const [notifications, setNotifications] = React.useState({\n email: true,\n sms: false,\n push: true,\n })\n const [theme, setTheme] = React.useState(\"light\")\n\n return (\n \n \n }\n >\n Complex Menu\n \n \n \n File\n \n \n New File\n ⌘N\n \n \n \n New Folder\n ⇧⌘N\n \n \n \n \n Open Recent\n \n \n \n \n Recent Projects\n \n \n Project Alpha\n \n \n \n Project Beta\n \n \n \n \n More Projects\n \n \n \n \n \n Project Gamma\n \n \n \n Project Delta\n \n \n \n \n \n \n \n \n \n Browse...\n \n \n \n \n \n \n \n \n Save\n ⌘S\n \n \n \n Export\n ⇧⌘E\n \n \n \n \n View\n \n setNotifications({ ...notifications, email: checked === true })\n }\n >\n \n Show Sidebar\n \n \n setNotifications({ ...notifications, sms: checked === true })\n }\n >\n \n Show Status Bar\n \n \n \n \n Theme\n \n \n \n \n Appearance\n \n \n \n Light\n \n \n \n Dark\n \n \n \n System\n \n \n \n \n \n \n \n \n \n Account\n \n \n Profile\n ⇧⌘P\n \n \n \n Billing\n \n \n \n \n Settings\n \n \n \n \n Preferences\n \n \n Keyboard Shortcuts\n \n \n \n Language\n \n \n \n \n Notifications\n \n \n \n \n \n Notification Types\n \n \n setNotifications({\n ...notifications,\n push: checked === true,\n })\n }\n >\n \n Push Notifications\n \n \n setNotifications({\n ...notifications,\n email: checked === true,\n })\n }\n >\n \n Email Notifications\n \n \n \n \n \n \n \n \n \n \n Privacy & Security\n \n \n \n \n \n \n \n \n \n \n Help & Support\n \n \n \n Documentation\n \n \n \n \n \n \n Sign Out\n ⇧⌘Q\n \n \n \n \n \n )\n}\n", "type": "registry:example" } ], "type": "registry:example" }