Dropdown Menu

Displays a menu to the user — such as a set of actions or functions — triggered by a button.

Code
import { Button } from "https://deno.land/x/testing_shadcn_ui_for_deno@0.1.2/components/button.tsx" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "https://deno.land/x/testing_shadcn_ui_for_deno@0.1.2/components/dropdown-menu.tsx" import IconBrandGithub from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/brand-github.tsx" import IconCirclePlus from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/circle-plus.tsx" import IconCloud from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/cloud.tsx" import IconCreditCard from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/credit-card.tsx" import IconLifebuoy from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/lifebuoy.tsx" import IconLogout from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/logout.tsx" import IconMail from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/mail.tsx" import IconMessage from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/message.tsx" import IconPlus from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/plus.tsx" import IconSettings from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/settings.tsx" import IconUser from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/user.tsx" import IconUsers from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/users.tsx" import IconUserPlus from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/user-plus.tsx" import IconKeyboard from "https://deno.land/x/tabler_icons_tsx@0.0.7/tsx/keyboard.tsx" export function DropdownMenuDemo() { return ( <DropdownMenu> <DropdownMenuTrigger asChild> <Button variant="outline">Open</Button> </DropdownMenuTrigger> <DropdownMenuContent class="w-56"> <DropdownMenuLabel>My Account</DropdownMenuLabel> <DropdownMenuSeparator /> <DropdownMenuGroup> <DropdownMenuItem> <IconUser class="mr-2 h-4 w-4" /> <span>Profile</span> <DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut> </DropdownMenuItem> <DropdownMenuItem> <IconCreditCard class="mr-2 h-4 w-4" /> <span>Billing</span> <DropdownMenuShortcut>⌘B</DropdownMenuShortcut> </DropdownMenuItem> <DropdownMenuItem> <IconSettings class="mr-2 h-4 w-4" /> <span>Settings</span> <DropdownMenuShortcut>⌘S</DropdownMenuShortcut> </DropdownMenuItem> <DropdownMenuItem> <IconKeyboard class="mr-2 h-4 w-4" /> <span>Keyboard shortcuts</span> <DropdownMenuShortcut>⌘K</DropdownMenuShortcut> </DropdownMenuItem> </DropdownMenuGroup> <DropdownMenuSeparator /> <DropdownMenuGroup> <DropdownMenuItem> <IconUsers class="mr-2 h-4 w-4" /> <span>Team</span> </DropdownMenuItem> <DropdownMenuSub> <DropdownMenuSubTrigger> <IconUserPlus class="mr-2 h-4 w-4" /> <span>Invite users</span> </DropdownMenuSubTrigger> <DropdownMenuPortal> <DropdownMenuSubContent> <DropdownMenuItem> <IconMail class="mr-2 h-4 w-4" /> <span>Email</span> </DropdownMenuItem> <DropdownMenuItem> <IconMessage class="mr-2 h-4 w-4" /> <span>Message</span> </DropdownMenuItem> <DropdownMenuSeparator /> <DropdownMenuItem> <IconCirclePlus class="mr-2 h-4 w-4" /> <span>More...</span> </DropdownMenuItem> </DropdownMenuSubContent> </DropdownMenuPortal> </DropdownMenuSub> <DropdownMenuItem> <IconPlus class="mr-2 h-4 w-4" /> <span>New Team</span> <DropdownMenuShortcut>⌘+T</DropdownMenuShortcut> </DropdownMenuItem> </DropdownMenuGroup> <DropdownMenuSeparator /> <DropdownMenuItem> <IconBrandGithub class="mr-2 h-4 w-4" /> <span>GitHub</span> </DropdownMenuItem> <DropdownMenuItem> <IconLifebuoy class="mr-2 h-4 w-4" /> <span>Support</span> </DropdownMenuItem> <DropdownMenuItem disabled> <IconCloud class="mr-2 h-4 w-4" /> <span>API</span> </DropdownMenuItem> <DropdownMenuSeparator /> <DropdownMenuItem> <IconLogout class="mr-2 h-4 w-4" /> <span>Log out</span> <DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut> </DropdownMenuItem> </DropdownMenuContent> </DropdownMenu> ) }