DynamicSideBar
DynamicSideBar handles hierarchical navigation menus with search filtering, brand logo slots, tenant module switchers, and user authentication profile card with a confirmation modal on logout.
Props & Configuration
8 propsComplete property specifications, parameter types, and default fallbacks.
| Property | Type | Default | Description |
|---|---|---|---|
| itemsRequired | MenuProps["items"] | — | Ant Design menu items array containing key, label, icon, and route. |
| user | { name?: string; email?: string; role?: string; avatar?: string } | — | User profile metadata displayed at the bottom. |
| onLogout | () => void | Promise<void> | — | Logout callback triggered after confirmation modal. |
| collapsed | boolean | false | Controls collapsed/expanded state. |
| collapsabled | boolean | true | Whether user can toggle collapse state. |
| logo | React.ReactNode | — | Logo or branding element at the top. |
| pathname | string | — | Current URL pathname for active route highlighting. |
| modules | { key: string; label: string }[] | — | Module switcher list for multi-app navigation. |
Interactive Examples & Live Previews
2 DemosEvery example includes its own live, interactive preview element alongside the corresponding copyable TypeScript snippet.
Basic App Navigation Menu
Navigation menu with icons and route keys.
DynamicSideBar handles hierarchical routing, permission-based filtering, and smooth collapse transitions.
1import React from "react";2import { DynamicSideBar } from "antd-dynamic-ui";3import { AppstoreOutlined, SettingOutlined } from "@ant-design/icons";45export default function BasicSidebar() {6 const menuItems = [7 { key: "/dashboard", label: "Dashboard", icon: <AppstoreOutlined /> },8 { key: "/settings", label: "Settings", icon: <SettingOutlined /> },9 ];1011 return (12 <div className="h-[500px] w-64 border-r">13 <DynamicSideBar items={menuItems} />14 </div>15 );16}
Complete Enterprise Sidebar with User Profile
Full sidebar with brand logo, module switcher, user profile card, and logout handler.
DynamicSideBar manages multi-tenant modules, role access checks, and uncommitted form confirmation guards.
1import React from "react";2import { DynamicSideBar } from "antd-dynamic-ui";3import {4 HomeOutlined,5 TeamOutlined,6 FileTextOutlined,7 SecurityScanOutlined,8} from "@ant-design/icons";910export default function EnterpriseSidebarDemo() {11 const items = [12 { key: "home", label: "Overview", icon: <HomeOutlined /> },13 { key: "team", label: "Team Members", icon: <TeamOutlined /> },14 { key: "billing", label: "Invoices", icon: <FileTextOutlined /> },15 { key: "audit", label: "Security & Audit", icon: <SecurityScanOutlined /> },16 ];1718 return (19 <div className="h-[600px] w-64 border-r bg-white border-[#ede5d8]">20 <DynamicSideBar21 items={items}22 logo={<span className="font-bold text-lg px-4">Corp Portal</span>}23 user={{24 name: "Ada Lovelace",25 email: "ada@computing.org",26 role: "Chief Architect",27 avatar: "https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=100",28 }}29 onLogout={async () => {30 alert("Logged out successfully");31 }}32 />33 </div>34 );35}
Frequently Asked Questions & Quick Solutions
Architectural patterns, React 19 compatibility, and integration tips for DynamicSideBar.
How does DynamicSideBar integrate with Ant Design 5.x and Next.js 15?▼
DynamicSideBar is designed as an enhanced, declarative wrapper for Ant Design. It fully supports Next.js 15 App Router when using @ant-design/nextjs-registry, eliminating SSR hydration mismatches and guaranteeing 0ms layout thrashing.
Can I customize validation, themes, and props for DynamicSideBar?▼
Yes. Every prop is fully typed in TypeScript 5 with comprehensive Intellisense. You can pass custom styling via className or style props, configure global Ant Design themes via ConfigProvider, and extend validation logic seamlessly.