Core Dynamic ComponentsAnt Design Drawer Accelerator

DynamicDrawer

DynamicDrawer provides an ergonomic slide-out sheet for secondary inspection workflows, side-by-side editing, filter sidebars, and entity audit timelines. Supports full placement control (right, left, top, bottom), responsive width calculations, and custom header actions.

Placement flexibility: 'right' (default), 'left', 'top', or 'bottom'
Responsive widths: accepts CSS units ('80vw', '600px', 720)
ExtraTitleChild slot for tags, status indicators, and secondary actions directly in the title bar
Sticky footer slot with separate footerClassName styling
Seamless integration with Ant Design token system and dark mode algorithms

Props & Configuration

10 props

Complete property specifications, parameter types, and default fallbacks.

PropertyTypeDefaultDescription
isOpenRequiredboolean—Whether the drawer panel is open.
onCloseRequired() => void—Callback triggered when clicking backdrop mask or close icon.
titleReact.ReactNode—Title rendered at the top of the drawer.
ExtraTitleChildReact.ReactNode—Additional element rendered adjacent to the title.
footerReact.ReactNode—Sticky bottom footer for action buttons.
placement"right" | "left" | "top" | "bottom""right"Direction from which drawer slides out.
widthstring | number"80vw"Custom width of the drawer sheet.
bodyClassNamestring—Custom CSS class for drawer body contents.
headerClassNamestring—Custom CSS class for header bar.
footerClassNamestring—Custom CSS class for footer bar.

Interactive Examples & Live Previews

2 Demos

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

Example 1

Basic Right-Side Drawer

Slide-out panel for record inspection and logs.

Live Interactive Demo
DynamicDrawer.basic.tsxtsx
1import React, { useState } from "react";
2import { DynamicDrawer, ButtonField } from "antd-dynamic-ui";
3
4export default function BasicDrawerDemo() {
5 const [isOpen, setIsOpen] = useState(false);
6
7 return (
8 <div className="p-4">
9 <ButtonField type="primary" onClick={() => setIsOpen(true)}>
10 Open Audit Drawer
11 </ButtonField>
12
13 <DynamicDrawer
14 isOpen={isOpen}
15 onClose={() => setIsOpen(false)}
16 title="Audit Logs"
17 width="450px"
18 >
19 <p className="text-sm text-zinc-600">Event traces for this tenant account...</p>
20 </DynamicDrawer>
21 </div>
22 );
23}
Example 2

Complete Props with Extra Title & Custom Placement

Drawer featuring extra title badge, custom width, custom placement, and sticky footer.

Live Interactive Demo
Placement:
DynamicDrawer.complete.tsxtsx
1import React, { useState } from "react";
2import { DynamicDrawer, ButtonField } from "antd-dynamic-ui";
3import { Tag } from "antd";
4
5export default function CompleteDrawerDemo() {
6 const [isOpen, setIsOpen] = useState(false);
7
8 return (
9 <div className="p-4">
10 <ButtonField onClick={() => setIsOpen(true)}>
11 Inspect Microservice Config
12 </ButtonField>
13
14 <DynamicDrawer
15 isOpen={isOpen}
16 onClose={() => setIsOpen(false)}
17 title="Service Mesh Config"
18 ExtraTitleChild={<Tag color="green">v2.4.1 Active</Tag>}
19 placement="right"
20 width="650px"
21 footer={
22 <div className="flex justify-between items-center w-full">
23 <span className="text-xs text-zinc-500">Last deployed 2 hours ago</span>
24 <div className="flex gap-2">
25 <ButtonField onClick={() => setIsOpen(false)}>Close</ButtonField>
26 <ButtonField type="primary">Rollback Config</ButtonField>
27 </div>
28 </div>
29 }
30 >
31 <div className="space-y-4">
32 <h4 className="font-semibold text-sm">Cluster Endpoint:</h4>
33 <code className="p-2 bg-zinc-100 rounded text-xs block">https://cluster-us-east-2.internal.net</code>
34 </div>
35 </DynamicDrawer>
36 </div>
37 );
38}

Frequently Asked Questions & Quick Solutions

Architectural patterns, React 19 compatibility, and integration tips for DynamicDrawer.

How does DynamicDrawer integrate with Ant Design 5.x and Next.js 15?▼

DynamicDrawer 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 DynamicDrawer?▼

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.