✨ Working with PDFs, images or videos? Discover 145+ free web apps built for everyday tasks

Sidebar

Organizes application navigation, sections, and workspace actions. Ships collapsible, icon-rail, nested, floating, and resizable variants with sections, badges, and footer slots.

Loading preview...

Examples

Practical examples and common states for the same installable component.

Collapsible

Shrinks the sidebar to an icon rail while preserving navigation access.

examples/sidebar-collapsible.tsx
import {
Sidebar,
SidebarHeader,
SidebarNav,
SidebarSection,
SidebarItem,
SidebarFooter,
SidebarToggle,
} from "@/components/wensity/sidebar";
import { IconLayoutDashboard, IconChartAreaLine, IconFolders, IconSettings } from "@tabler/icons-react";
export function SidebarCollapsible() {
return (
<Sidebar variant="collapsible" width={220}>
<SidebarHeader>
<span className="text-sm font-semibold">Acme Inc</span>
<SidebarToggle className="ml-auto" />
</SidebarHeader>
<SidebarNav>
<SidebarSection>
<SidebarItem icon={<IconLayoutDashboard className="size-[18px]" />} active>
Dashboard
</SidebarItem>
<SidebarItem icon={<IconChartAreaLine className="size-[18px]" />}>Analytics</SidebarItem>
<SidebarItem icon={<IconFolders className="size-[18px]" />}>Projects</SidebarItem>
<SidebarItem icon={<IconSettings className="size-[18px]" />}>Settings</SidebarItem>
</SidebarSection>
</SidebarNav>
<SidebarFooter>
<span className="text-xs text-muted-foreground">jordan@acme.com</span>
</SidebarFooter>
</Sidebar>
);
}

Icon Rail

Compact icon-only navigation. Labels surface as native tooltips.

examples/sidebar-icon-rail.tsx
import { Sidebar, SidebarNav, SidebarSection, SidebarItem } from "@/components/wensity/sidebar";
import { IconLayoutDashboard, IconChartAreaLine, IconInbox, IconBell, IconSettings } from "@tabler/icons-react";
export function SidebarIconRail() {
return (
<Sidebar variant="icon-rail" aria-label="Icon navigation">
<SidebarNav>
<SidebarSection>
<SidebarItem icon={<IconLayoutDashboard className="size-[18px]" />} active>
Dashboard
</SidebarItem>
<SidebarItem icon={<IconChartAreaLine className="size-[18px]" />}>Analytics</SidebarItem>
<SidebarItem icon={<IconInbox className="size-[18px]" />}>Inbox</SidebarItem>
<SidebarItem icon={<IconBell className="size-[18px]" />}>Notifications</SidebarItem>
<SidebarItem icon={<IconSettings className="size-[18px]" />}>Settings</SidebarItem>
</SidebarSection>
</SidebarNav>
</Sidebar>
);
}

Nested

Expandable multi-level navigation groups with an inset guide line.

examples/sidebar-nested.tsx
import { Sidebar, SidebarNav, SidebarSection, SidebarItem, SidebarNested } from "@/components/wensity/sidebar";
import { IconRocket, IconShield } from "@tabler/icons-react";
export function SidebarNestedDemo() {
return (
<Sidebar width={230}>
<SidebarNav>
<SidebarSection label="Platform">
<SidebarNested icon={<IconRocket className="size-[18px]" />} label="Deployments" defaultOpen>
<SidebarItem>Production</SidebarItem>
<SidebarItem>Staging</SidebarItem>
</SidebarNested>
<SidebarNested icon={<IconShield className="size-[18px]" />} label="Security" defaultOpen active>
<SidebarItem active>API Keys</SidebarItem>
<SidebarItem>Audit Log</SidebarItem>
<SidebarItem>Single Sign-On</SidebarItem>
</SidebarNested>
</SidebarSection>
</SidebarNav>
</Sidebar>
);
}

Floating

Detached sidebar with inset spacing, rounded edges, and a soft shadow.

examples/sidebar-floating.tsx
import { Sidebar, SidebarNav, SidebarSection, SidebarItem } from "@/components/wensity/sidebar";
import { IconInbox, IconBox, IconUsers } from "@tabler/icons-react";
export function SidebarFloating() {
return (
<Sidebar variant="floating" width={220}>
<SidebarNav>
<SidebarSection>
<SidebarItem icon={<IconInbox className="size-[18px]" />} active>
Inbox
</SidebarItem>
<SidebarItem icon={<IconBox className="size-[18px]" />}>Products</SidebarItem>
<SidebarItem icon={<IconUsers className="size-[18px]" />}>Customers</SidebarItem>
</SidebarSection>
</SidebarNav>
</Sidebar>
);
}

Resizable

Drag the edge to adjust width. Arrow keys resize; double-click resets.

examples/sidebar-resizable.tsx
import { Sidebar, SidebarNav, SidebarSection, SidebarItem } from "@/components/wensity/sidebar";
import { IconLayoutDashboard, IconChartAreaLine, IconUsers } from "@tabler/icons-react";
export function SidebarResizable() {
return (
<Sidebar variant="resizable" width={220} minWidth={170} maxWidth={340}>
<SidebarNav>
<SidebarSection label="Reports">
<SidebarItem icon={<IconLayoutDashboard className="size-[18px]" />}>Dashboard</SidebarItem>
<SidebarItem icon={<IconChartAreaLine className="size-[18px]" />} active>
Customer Analytics
</SidebarItem>
<SidebarItem icon={<IconUsers className="size-[18px]" />}>Cohort Retention</SidebarItem>
</SidebarSection>
</SidebarNav>
</Sidebar>
);
}