Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(SideNav): add Collapsible Sidebar story (#2443)

Andrey Goder77a00e682cb5
diff --git a/apps/storybook/stories/SideNav.stories.tsx b/apps/storybook/stories/SideNav.stories.tsx
index 5f0c771ef1..6a83dfdae8 100644
--- a/apps/storybook/stories/SideNav.stories.tsx
+++ b/apps/storybook/stories/SideNav.stories.tsx
@@ -598,6 +598,83 @@ export const CollapsibleItems: Story = {
),
};
+// =============================================================================
+// Collapsible Sidebar
+// =============================================================================
+
+export const CollapsibleSidebar: Story = {
+ name: 'Collapsible Sidebar',
+ render: () => (
+ <XDSSideNav
+ collapsible
+ header={
+ <XDSSideNavHeading
+ icon={
+ <XDSNavIcon icon={<CubeIcon style={{width: 16, height: 16}} />} />
+ }
+ heading="My App"
+ headingHref="/"
+ />
+ }
+ footerIcons={
+ <>
+ <XDSButton
+ label="Help"
+ icon={<XDSIcon icon={QuestionMarkCircleIcon} size="md" />}
+ variant="ghost"
+ size="sm"
+ isIconOnly
+ />
+ <XDSButton
+ label="Notifications"
+ icon={<XDSIcon icon={BellIcon} size="md" />}
+ variant="ghost"
+ size="sm"
+ isIconOnly
+ />
+ </>
+ }>
+ <XDSSideNavSection title="Main">
+ <XDSSideNavItem
+ label="Dashboard"
+ icon={HomeIcon}
+ selectedIcon={HomeIconSolid}
+ isSelected
+ href="/dashboard"
+ />
+ <XDSSideNavItem
+ label="Projects"
+ icon={FolderIcon}
+ selectedIcon={FolderIconSolid}
+ href="/projects"
+ endContent={<XDSBadge label="3" />}
+ />
+ <XDSSideNavItem
+ label="Analytics"
+ icon={ChartBarIcon}
+ href="/analytics"
+ />
+ <XDSSideNavItem label="Team" icon={UserGroupIcon} href="/team" />
+ </XDSSideNavSection>
+ <XDSSideNavSection title="Settings">
+ <XDSSideNavItem label="Settings" icon={Cog6ToothIcon} collapsible>
+ <XDSSideNavItem label="General" href="/settings/general" />
+ <XDSSideNavItem label="Security" href="/settings/security" />
+ <XDSSideNavItem
+ label="Notifications"
+ href="/settings/notifications"
+ />
+ </XDSSideNavItem>
+ <XDSSideNavItem
+ label="Documents"
+ icon={DocumentTextIcon}
+ href="/documents"
+ />
+ </XDSSideNavSection>
+ </XDSSideNav>
+ ),
+};
+
// =============================================================================
// Iconless Items with Nested Children
// =============================================================================