nyuchimzizi
Mzizi — an open-architecture project of the Bundu Foundation, operated and developed by Nyuchi. Built on the Five African Minerals palette.
Built by Nyuchi Africav4.0.39
Sidebar with workspace switcher.
View the full component source code below.
"use client"
import { useState } from "react"
import { Button } from "@/components/ui/button"
import { Separator } from "@/components/ui/separator"
import { Home, BarChart3, Users, FileText, Settings, ChevronsUpDown, Check } from "@/lib/icons"
const workspaces = [
{ id: "mukoko", label: "mukoko", color: "bg-cobalt" },
{ id: "nhimbe", label: "nhimbe", color: "bg-tanzanite" },
{ id: "bundu", label: "bundu", color: "bg-malachite" },
]
const navItems = [
{ icon: Home, label: "Home" },
{ icon: BarChart3, label: "Analytics" },
{ icon: Users, label: "Team" },
{ icon: FileText, label: "Documents" },
{ icon: Settings, label: "Settings" },
]
function Sidebar15() {
const [activeWs, setActiveWs] = useState("mukoko")
const [wsOpen, setWsOpen] = useState(false)
return (
<aside data-slot="sidebar-block" data-portal="https://design.nyuchi.com/components/sidebar-block" aria-label="Sidebar navigation" className="flex h-screen w-60 flex-col border-r border-border bg-card">
{/* Workspace switcher */}
<div className="relative p-3">
<button
onClick={() => setWsOpen(!wsOpen)}
className="flex w-full items-center gap-3 rounded-[var(--radius-lg,14px)] border border-border px-3 py-2 text-left transition-colors hover:bg-muted"
>
<span
className={`size-5 shrink-0 rounded ${workspaces.find((w) => w.id === activeWs)?.color}`}
/>
<span className="flex-1 text-sm font-medium text-foreground">
{workspaces.find((w) => w.id === activeWs)?.label}
</span>
<ChevronsUpDown className="size-4 text-muted-foreground" />
</button>
{wsOpen && (
<div className="absolute inset-x-3 top-full z-10 mt-1 rounded-[var(--radius-lg,14px)] border border-border bg-popover p-1 shadow-md">
{workspaces.map((ws) => (
<button
key={ws.id}
onClick={() => {
setActiveWs(ws.id)
setWsOpen(false)
}}
className="flex w-full items-center gap-3 rounded-[var(--radius-md,12px)] px-3 py-2 text-sm transition-colors hover:bg-muted"
>
<span className={`size-4 shrink-0 rounded ${ws.color}`} />
<span className="flex-1 text-foreground">{ws.label}</span>
{activeWs === ws.id && <Check className="size-4 text-malachite" />}
</button>
))}
</div>
)}
</div>
<Separator />
<nav className="flex-1 space-y-1 p-3">
{navItems.map((item) => (
<Button key={item.label} variant="ghost" className="w-full justify-start gap-3" size="sm">
<item.icon className="size-4" />
{item.label}
</Button>
))}
</nav>
</aside>
)
}
export { Sidebar15 }
npx shadcn@latest add https://mzizi.dev/api/v1/ui/sidebar-15Fetch this component's metadata and source code from the registry API.
/api/v1/ui/sidebar-15components/blocks/sidebar-15.tsx