Core Dynamic ComponentsEnterprise Nav Rail

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.

Hierarchical menu items with Ant Design icon support
Integrated user profile popover with department and avatar
Form dirty protection: warns before navigating away from unsaved forms
Module switcher for multi-tenant or multi-app suites
Collapsible rail mode with smooth animations

Props & Configuration

8 props

Complete property specifications, parameter types, and default fallbacks.

PropertyTypeDefaultDescription
itemsRequiredMenuProps["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.
collapsedbooleanfalseControls collapsed/expanded state.
collapsabledbooleantrueWhether user can toggle collapse state.
logoReact.ReactNode—Logo or branding element at the top.
pathnamestring—Current URL pathname for active route highlighting.
modules{ key: string; label: string }[]—Module switcher list for multi-app navigation.

Interactive Examples & Live Previews

2 Demos

Every example includes its own live, interactive preview element alongside the corresponding copyable TypeScript snippet.

Example 1

Basic App Navigation Menu

Navigation menu with icons and route keys.

Live Interactive Demo
Platform Navigation
Logged in as admin@corp.io
Active Route: /dashboard

DynamicSideBar handles hierarchical routing, permission-based filtering, and smooth collapse transitions.

DynamicSidebar.basic.tsxtsx
1import React from "react";
2import { DynamicSideBar } from "antd-dynamic-ui";
3import { AppstoreOutlined, SettingOutlined } from "@ant-design/icons";
4
5export default function BasicSidebar() {
6 const menuItems = [
7 { key: "/dashboard", label: "Dashboard", icon: <AppstoreOutlined /> },
8 { key: "/settings", label: "Settings", icon: <SettingOutlined /> },
9 ];
10
11 return (
12 <div className="h-[500px] w-64 border-r">
13 <DynamicSideBar items={menuItems} />
14 </div>
15 );
16}
Example 2

Complete Enterprise Sidebar with User Profile

Full sidebar with brand logo, module switcher, user profile card, and logout handler.

Live Interactive Demo
Active Workspace Module:
CRM & Sales
Sales CRM
v2.4
AL
Ada Lovelace
Chief Architect
Current Module: SALES
Active Route: /dashboard

DynamicSideBar manages multi-tenant modules, role access checks, and uncommitted form confirmation guards.

DynamicSidebar.complete.tsxtsx
1import React from "react";
2import { DynamicSideBar } from "antd-dynamic-ui";
3import {
4 HomeOutlined,
5 TeamOutlined,
6 FileTextOutlined,
7 SecurityScanOutlined,
8} from "@ant-design/icons";
9
10export 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 ];
17
18 return (
19 <div className="h-[600px] w-64 border-r bg-white border-[#ede5d8]">
20 <DynamicSideBar
21 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.