1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"use client";
import type { CSSProperties } from "react";
import { FolderIcon, LayoutDashboardIcon, SettingsIcon } from "lucide-react";
import {
Sidebar,
SidebarContent,
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,
SidebarInset,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
SidebarProvider,
SidebarTrigger,
} from "@/components/ui/sidebar";
export default function SidebarBasicPreview() {
return (
<SidebarProvider
className="relative min-h-[280px] overflow-hidden rounded-panel shadow-popup"
style={
{
minHeight: 280,
"--sidebar-width": "11rem",
"--sidebar-width-icon": "3rem",
} as CSSProperties
}
>
<Sidebar collapsible="icon" className="!absolute !h-full">
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>Workspace</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{[
{ label: "Dashboard", icon: LayoutDashboardIcon },
{ label: "Projects", icon: FolderIcon },
{ label: "Settings", icon: SettingsIcon },
].map(({ label, icon: Icon }) => (
<SidebarMenuItem key={label}>
<SidebarMenuButton tooltip={label}>
<Icon aria-hidden />
<span>{label}</span>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
</Sidebar>
<SidebarInset className="min-h-0 p-3">
<SidebarTrigger />
<div className="mt-8 text-[13px] text-muted-foreground">
Main content
</div>
</SidebarInset>
</SidebarProvider>
);
}