GodUIGodUI
109Follow on X

Open the menu and pick an action

Dropdown Menu

tsx
"use client";import { DropdownMenu } from "@/components/godui/dropdown-menu";import { User, CreditCard, Users, Plus, LogOut } from "lucide-react";import { useState } from "react";export function AccountMenu() {const [last, setLast] = useState(null);const items = [  { type: "label", label: "Signed in as ada@northwind.com" },  { label: "Profile", icon: <User className="size-4" />, shortcut: "⌘P", onSelect: () => setLast("Profile") },  { label: "Billing", icon: <CreditCard className="size-4" />, onSelect: () => setLast("Billing") },  {    label: "Switch workspace",    icon: <Users className="size-4" />,    submenu: [      { label: "Northwind", onSelect: () => setLast("Northwind") },      { label: "Acme Inc.", onSelect: () => setLast("Acme Inc.") },      { type: "separator" },      { label: "New workspace", icon: <Plus className="size-4" />, onSelect: () => setLast("New") },    ],  },  { type: "separator" },  { label: "Log out", icon: <LogOut className="size-4" />, onSelect: () => setLast("Log out") },];return <DropdownMenu align="end" trigger={<button>Ada Lovelace</button>} items={items} />;}