|
| 1 | +'use client'; |
| 2 | + |
| 3 | +import { Bell, Calendar, ChartBar, CreditCard, EllipsisV, Folder, Home, Inbox, Search, ShoppingCart, Sparkles, Star, Users } from '@primeicons/react'; |
| 4 | +import { Sidebar } from './sidebar'; |
| 5 | + |
| 6 | +export default function SidebarPage() { |
| 7 | + return ( |
| 8 | + <div className="relative my-20 max-w-3xl w-full mx-auto border border-surface-200 dark:border-surface-700 rounded-lg overflow-hidden"> |
| 9 | + <Sidebar.Manager className="min-h-[50vh] "> |
| 10 | + <Sidebar.HoverArea /> |
| 11 | + <Sidebar.Root className="h-[50vh]"> |
| 12 | + <Sidebar.Rail /> |
| 13 | + <Sidebar.Header> |
| 14 | + <Sidebar.Menu> |
| 15 | + <Sidebar.MenuItem> |
| 16 | + <Sidebar.MenuButton tooltip="Acme Inc" className="h-auto! p-0 group-data-[collapsible=icon]:p-0! "> |
| 17 | + <div className="flex size-8 shrink-0 items-center justify-center rounded-lg bg-blue-600 text-surface-50"> |
| 18 | + <Sparkles className="size-3" /> |
| 19 | + </div> |
| 20 | + <span className="font-semibold text-base">Acme Inc</span> |
| 21 | + </Sidebar.MenuButton> |
| 22 | + <Sidebar.MenuAction showOnHover> |
| 23 | + <EllipsisV /> |
| 24 | + </Sidebar.MenuAction> |
| 25 | + </Sidebar.MenuItem> |
| 26 | + </Sidebar.Menu> |
| 27 | + </Sidebar.Header> |
| 28 | + |
| 29 | + <Sidebar.Content> |
| 30 | + {/* Main Navigation */} |
| 31 | + <Sidebar.Group> |
| 32 | + <Sidebar.GroupLabel>Navigation</Sidebar.GroupLabel> |
| 33 | + <Sidebar.GroupContent> |
| 34 | + <Sidebar.Menu> |
| 35 | + <Sidebar.MenuItem> |
| 36 | + <Sidebar.MenuButton isActive tooltip="Home"> |
| 37 | + <Home /> |
| 38 | + <span>Home</span> |
| 39 | + </Sidebar.MenuButton> |
| 40 | + <Sidebar.MenuAction showOnHover> |
| 41 | + <EllipsisV /> |
| 42 | + </Sidebar.MenuAction> |
| 43 | + </Sidebar.MenuItem> |
| 44 | + <Sidebar.MenuItem> |
| 45 | + <Sidebar.MenuButton tooltip="Inbox"> |
| 46 | + <Inbox /> |
| 47 | + <span>Inbox</span> |
| 48 | + <span className="ml-auto rounded-full bg-neutral-900 px-1.5 py-0.5 text-xs text-neutral-50 group-data-[collapsible=icon]:hidden">12</span> |
| 49 | + </Sidebar.MenuButton> |
| 50 | + <Sidebar.MenuAction showOnHover> |
| 51 | + <EllipsisV /> |
| 52 | + </Sidebar.MenuAction> |
| 53 | + </Sidebar.MenuItem> |
| 54 | + <Sidebar.MenuItem> |
| 55 | + <Sidebar.MenuButton tooltip="Search"> |
| 56 | + <Search /> |
| 57 | + <span>Search</span> |
| 58 | + </Sidebar.MenuButton> |
| 59 | + <Sidebar.MenuAction showOnHover> |
| 60 | + <EllipsisV /> |
| 61 | + </Sidebar.MenuAction> |
| 62 | + </Sidebar.MenuItem> |
| 63 | + <Sidebar.MenuItem> |
| 64 | + <Sidebar.MenuButton tooltip="Notifications"> |
| 65 | + <Bell /> |
| 66 | + <span>Notifications</span> |
| 67 | + <span className="ml-auto rounded-full bg-neutral-900 px-1.5 py-0.5 text-xs text-neutral-50 group-data-[collapsible=icon]:hidden">3</span> |
| 68 | + </Sidebar.MenuButton> |
| 69 | + <Sidebar.MenuAction showOnHover> |
| 70 | + <EllipsisV /> |
| 71 | + </Sidebar.MenuAction> |
| 72 | + </Sidebar.MenuItem> |
| 73 | + </Sidebar.Menu> |
| 74 | + </Sidebar.GroupContent> |
| 75 | + </Sidebar.Group> |
| 76 | + |
| 77 | + {/* Projects */} |
| 78 | + <Sidebar.Group> |
| 79 | + <Sidebar.GroupLabel>Projects</Sidebar.GroupLabel> |
| 80 | + <Sidebar.GroupContent> |
| 81 | + <Sidebar.Menu> |
| 82 | + <Sidebar.MenuItem> |
| 83 | + <Sidebar.MenuButton tooltip="Analytics"> |
| 84 | + <ChartBar /> |
| 85 | + <span>Analytics</span> |
| 86 | + </Sidebar.MenuButton> |
| 87 | + <Sidebar.MenuAction showOnHover> |
| 88 | + <EllipsisV /> |
| 89 | + </Sidebar.MenuAction> |
| 90 | + </Sidebar.MenuItem> |
| 91 | + <Sidebar.MenuItem> |
| 92 | + <Sidebar.MenuButton tooltip="Team"> |
| 93 | + <Users /> |
| 94 | + <span>Team</span> |
| 95 | + </Sidebar.MenuButton> |
| 96 | + <Sidebar.MenuAction showOnHover> |
| 97 | + <EllipsisV /> |
| 98 | + </Sidebar.MenuAction> |
| 99 | + </Sidebar.MenuItem> |
| 100 | + <Sidebar.MenuItem> |
| 101 | + <Sidebar.MenuButton tooltip="Calendar"> |
| 102 | + <Calendar /> |
| 103 | + <span>Calendar</span> |
| 104 | + </Sidebar.MenuButton> |
| 105 | + <Sidebar.MenuAction showOnHover> |
| 106 | + <EllipsisV /> |
| 107 | + </Sidebar.MenuAction> |
| 108 | + </Sidebar.MenuItem> |
| 109 | + <Sidebar.MenuItem> |
| 110 | + <Sidebar.MenuButton tooltip="Documents"> |
| 111 | + <Folder /> |
| 112 | + <span>Documents</span> |
| 113 | + </Sidebar.MenuButton> |
| 114 | + <Sidebar.MenuAction showOnHover> |
| 115 | + <EllipsisV /> |
| 116 | + </Sidebar.MenuAction> |
| 117 | + </Sidebar.MenuItem> |
| 118 | + </Sidebar.Menu> |
| 119 | + </Sidebar.GroupContent> |
| 120 | + </Sidebar.Group> |
| 121 | + |
| 122 | + {/* Billing */} |
| 123 | + <Sidebar.Group> |
| 124 | + <Sidebar.GroupLabel>Billing</Sidebar.GroupLabel> |
| 125 | + <Sidebar.GroupContent> |
| 126 | + <Sidebar.Menu> |
| 127 | + <Sidebar.MenuItem> |
| 128 | + <Sidebar.MenuButton tooltip="Payments"> |
| 129 | + <CreditCard /> |
| 130 | + <span>Payments</span> |
| 131 | + </Sidebar.MenuButton> |
| 132 | + <Sidebar.MenuAction showOnHover> |
| 133 | + <EllipsisV /> |
| 134 | + </Sidebar.MenuAction> |
| 135 | + </Sidebar.MenuItem> |
| 136 | + <Sidebar.MenuItem> |
| 137 | + <Sidebar.MenuButton tooltip="Orders"> |
| 138 | + <ShoppingCart /> |
| 139 | + <span>Orders</span> |
| 140 | + </Sidebar.MenuButton> |
| 141 | + <Sidebar.MenuAction showOnHover> |
| 142 | + <EllipsisV /> |
| 143 | + </Sidebar.MenuAction> |
| 144 | + </Sidebar.MenuItem> |
| 145 | + <Sidebar.MenuItem> |
| 146 | + <Sidebar.MenuButton tooltip="Subscriptions"> |
| 147 | + <Star /> |
| 148 | + <span>Subscriptions</span> |
| 149 | + </Sidebar.MenuButton> |
| 150 | + <Sidebar.MenuAction showOnHover> |
| 151 | + <EllipsisV /> |
| 152 | + </Sidebar.MenuAction> |
| 153 | + </Sidebar.MenuItem> |
| 154 | + </Sidebar.Menu> |
| 155 | + </Sidebar.GroupContent> |
| 156 | + </Sidebar.Group> |
| 157 | + </Sidebar.Content> |
| 158 | + |
| 159 | + <Sidebar.Footer> |
| 160 | + <Sidebar.Menu> |
| 161 | + <Sidebar.MenuItem> |
| 162 | + <Sidebar.MenuButton tooltip="John Doe" className="h-auto! p-0 group-data-[collapsible=icon]:p-0!"> |
| 163 | + <div className="flex size-8 shrink-0 items-center justify-center rounded-full bg-surface-200 dark:bg-surface-800 text-xs font-medium">JD</div> |
| 164 | + <span>John Doe</span> |
| 165 | + </Sidebar.MenuButton> |
| 166 | + <Sidebar.MenuAction showOnHover> |
| 167 | + <EllipsisV /> |
| 168 | + </Sidebar.MenuAction> |
| 169 | + </Sidebar.MenuItem> |
| 170 | + </Sidebar.Menu> |
| 171 | + </Sidebar.Footer> |
| 172 | + </Sidebar.Root> |
| 173 | + |
| 174 | + <Sidebar.Inset> |
| 175 | + <header className="flex h-12 items-center gap-2 border-b border-surface-200 dark:border-surface-700 px-4"> |
| 176 | + <Sidebar.Trigger /> |
| 177 | + <span className="text-sm font-medium">Dashboard</span> |
| 178 | + </header> |
| 179 | + <div className="flex-1 p-6"> |
| 180 | + <h1 className="text-2xl font-bold mb-4">Welcome back, John</h1> |
| 181 | + <p className="text-muted-color">Select an item from the sidebar to get started.</p> |
| 182 | + </div> |
| 183 | + </Sidebar.Inset> |
| 184 | + </Sidebar.Manager> |
| 185 | + </div> |
| 186 | + ); |
| 187 | +} |
0 commit comments