logoAnt Design

⌘ K
  • 디자인
  • 개발
  • 컴포넌트
  • 블로그
  • 자료
5.21.3
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
      5.13.0

Drawer

A panel that slides out from the edge of the screen.
가져오기import{ Drawer }from"antd";
소스components/drawer
문서
이 페이지 수정변경 로그

Resources

Ant Design Charts
Ant Design Pro
Ant Design Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
ahooks-React Hooks Library
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference
Work with Us

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

A Drawer is a panel that is typically overlaid on top of a page and slides in from the side. It contains a set of information or actions. Since the user can interact with the Drawer without leaving the current page, tasks can be achieved more efficiently within the same context.

  • Use a Form to create or edit a set of information.
  • Processing subtasks. When subtasks are too heavy for a Popover and we still want to keep the subtasks in the context of the main task, Drawer comes very handy.
  • When the same Form is needed in multiple places.

Notes for developers

Since the 5.17.0, we provided the loading prop by the Spin. However, since the 5.18.0 version, we have fixed this design error and replaced the Spin with the Skeleton, and also modified the type of loading prop, which can only accept boolean type.

Examples

API

Common props ref:Common props

Note

v5 uses rootClassName & rootStyle to configure the outermost element style, instead of className & style from v4. This is done to align the API with Modal.

PropsDescriptionTypeDefaultVersion
autoFocusWhether Drawer should get focused after openbooleantrue4.17.0
afterOpenChangeCallback after the animation ends when switching drawersfunction(open)-
classNameConfig Drawer Panel className. Use rootClassName if want to config top DOM stylestring-
classNamesSemantic structure classNameRecord<SemanticDOM, string>-5.10.0
closeIconCustom close icon. 5.7.0: close button will be hidden when setting to null or falseReactNode<CloseOutlined />
destroyOnCloseWhether to unmount child components on closing drawer or notbooleanfalse
extraExtra actions area at cornerReactNode-4.17.0
footerThe footer for DrawerReactNode-
forceRenderPre-render Drawer component forciblybooleanfalse
getContainermounted node and display window for DrawerHTMLElement | () => HTMLElement | Selectors | falsebody
headerStyleStyle of the drawer header partCSSProperties-
heightPlacement is top or bottom, height of the Drawer dialogstring | number378
keyboardWhether support press esc to closebooleantrue
maskWhether to show mask or notbooleantrue
maskClosableClicking on the mask (area outside the Drawer) to close the Drawer or notbooleantrue
placementThe placement of the Drawertop | right | bottom | leftright
pushNested drawers push behaviorboolean | { distance: string | number }{ distance: 180 }4.5.0+
rootStyleStyle of wrapper element which contains mask compare to styleCSSProperties-
styleStyle of Drawer panel. Use bodyStyle if want to config body onlyCSSProperties-
stylesSemantic structure styleRecord<SemanticDOM, CSSProperties>-5.10.0
sizepreset size of drawer, default 378px and large 736px'default' | 'large''default'4.17.0
titleThe title for DrawerReactNode-
loadingShow the Skeletonbooleanfalse5.17.0
openWhether the Drawer dialog is visible or notbooleanfalse
widthWidth of the Drawer dialogstring | number378
zIndexThe z-index of the Drawernumber1000
onCloseSpecify a callback that will be called when a user clicks mask, close button or Cancel buttonfunction(e)-
drawerRenderCustom drawer content render(node: ReactNode) => ReactNode-5.18.0

Semantic DOM

Design Token

컴포넌트 토큰어떻게 사용하나요?

토큰 이름설명타입기본값
footerPaddingBlock底部区域纵向内间距number8
footerPaddingInline底部区域横向内间距number16
zIndexPopup弹窗 z-indexnumber1000

글로벌 토큰어떻게 사용하나요?

Basic
codepen icon
External Link Icon
expand codeexpand code
Loading
codepen icon
External Link Icon
expand codeexpand code
5.17.0
Render in current dom
codepen icon
External Link Icon
expand codeexpand code
Preview drawer
codepen icon
External Link Icon
expand codeexpand code
Preset size
codepen icon
External Link Icon
expand codeexpand code
ConfigProvider
codepen icon
External Link Icon
expand codeexpand code
_InternalPanelDoNotUseOrYouWillBeFired
codepen icon
External Link Icon
expand codeexpand code
Component Token
codepen icon
External Link Icon
expand codeexpand code
Custom Placement
codepen icon
External Link Icon
expand codeexpand code
Extra Actions
codepen icon
External Link Icon
expand codeexpand code
Submit form in drawer
codepen icon
External Link Icon
expand codeexpand code
Multi-level drawer
codepen icon
External Link Icon
expand codeexpand code
Customize className for build-in module
codepen icon
External Link Icon
expand codeexpand code
No mask
codepen icon
External Link Icon
expand codeexpand code
Scroll Debug
codepen icon
External Link Icon
expand codeexpand code
Render in this
  • Lily

    Progresser XTech
    • View Profile
  • Lily

    Progresser XTech
    • View Profile
Hello Title
Hello Content
Footer!
Hello Title
Hello Content
Footer!
  • mask
    5.13.0
    마스크 요소
  • content
    5.13.0
    Drawer 컨테이너 요소
  • header
    5.13.0
    헤더 요소
  • body
    5.13.0
    내용 요소
  • footer
    5.13.0
    푸터 요소