Left navigation
Open on-demand navigation from the left edge. Links are wrapped in SheetClose so choosing a destination also closes the panel.
"use client"
import { Button } from "@/components/ui/button"
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"
const sections = [
{ label: "Overview", href: "#overview", current: true },
{ label: "Projects", href: "#projects" },
{ label: "Members", href: "#members" },
{ label: "Billing", href: "#billing" },
{ label: "Settings", href: "#settings" },
]
export function SheetLeftNavigation() {
return (
<div className="flex flex-wrap items-center gap-3">
<Sheet>
<SheetTrigger asChild>
<Button intent="neutral" emphasis="stroke">
Browse sections
</Button>
</SheetTrigger>
<SheetContent side="left">
<SheetHeader>
<SheetTitle>Workspace sections</SheetTitle>
<SheetDescription>Jump to another part of this workspace.</SheetDescription>
</SheetHeader>
<nav aria-label="Workspace sections">
<ul className="flex flex-col gap-1">
{sections.map((section) => (
<li key={section.href}>
<SheetClose asChild>
<a
href={section.href}
aria-current={section.current ? "page" : undefined}
className="flex min-h-10 items-center rounded-8 px-3 text-label-sm text-sub-600 hover:bg-weak-50 hover:text-strong-950 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base aria-[current=page]:bg-weak-50 aria-[current=page]:text-strong-950"
>
{section.label}
</a>
</SheetClose>
</li>
))}
</ul>
</nav>
</SheetContent>
</Sheet>
</div>
)
}