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.
Props & Configuration
10 propsComplete property specifications, parameter types, and default fallbacks.
| Property | Type | Default | Description |
|---|---|---|---|
| isOpenRequired | boolean | — | Whether the drawer panel is open. |
| onCloseRequired | () => void | — | Callback triggered when clicking backdrop mask or close icon. |
| title | React.ReactNode | — | Title rendered at the top of the drawer. |
| ExtraTitleChild | React.ReactNode | — | Additional element rendered adjacent to the title. |
| footer | React.ReactNode | — | Sticky bottom footer for action buttons. |
| placement | "right" | "left" | "top" | "bottom" | "right" | Direction from which drawer slides out. |
| width | string | number | "80vw" | Custom width of the drawer sheet. |
| bodyClassName | string | — | Custom CSS class for drawer body contents. |
| headerClassName | string | — | Custom CSS class for header bar. |
| footerClassName | string | — | Custom CSS class for footer bar. |
Interactive Examples & Live Previews
2 DemosEvery example includes its own live, interactive preview element alongside the corresponding copyable TypeScript snippet.
Basic Right-Side Drawer
Slide-out panel for record inspection and logs.
1import React, { useState } from "react";2import { DynamicDrawer, ButtonField } from "antd-dynamic-ui";34export default function BasicDrawerDemo() {5 const [isOpen, setIsOpen] = useState(false);67 return (8 <div className="p-4">9 <ButtonField type="primary" onClick={() => setIsOpen(true)}>10 Open Audit Drawer11 </ButtonField>1213 <DynamicDrawer14 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}
Complete Props with Extra Title & Custom Placement
Drawer featuring extra title badge, custom width, custom placement, and sticky footer.
1import React, { useState } from "react";2import { DynamicDrawer, ButtonField } from "antd-dynamic-ui";3import { Tag } from "antd";45export default function CompleteDrawerDemo() {6 const [isOpen, setIsOpen] = useState(false);78 return (9 <div className="p-4">10 <ButtonField onClick={() => setIsOpen(true)}>11 Inspect Microservice Config12 </ButtonField>1314 <DynamicDrawer15 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.