logoNamu Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
1.0.0
  • Components Overview
  • General
    • Button
    • FloatButtonNew
    • Icon
    • Typography
  • Layout
    • Divider
    • Grid
    • Layout
    • Space
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPickerNew
    • 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
    • QRCodeNew
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • TourNew
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • AppNew
    • ConfigProvider
When To Use
Examples
Basic
Custom Placement
Extra Actions
Render in current dom
Submit form in drawer
Preview drawer
Multi-level drawer
Preset size
API
Design Token

Drawer

  • AlertMessage

    Resources

    Namu Design Charts
    Namu Design Pro
    Namu Design Pro Components
    Namu Design Mobile
    Namu Design Mini
    Namu 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 Namu Design
    Medium
    Twitter
    yuqueNamu Design in YuQue
    Namu Design in Zhihu
    Experience Cloud Blog
    seeconfSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTechMore Products

    yuqueYuQue-Document Collaboration Platform
    AntVAntV-Data Visualization
    EggEgg-Enterprise Node.js Framework
    kitchenKitchen-Sketch Toolkit
    xtechAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Namu Design Community

    A panel which slides in from the edge of the screen.

    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.

    Examples

    Basic

    Basic drawer.

    expand codeexpand code
    Extra Actions

    Extra actions should be placed at corner of drawer in Namu Design, you can use extra prop for that.

    expand codeexpand code
    Submit form in drawer

    Use a form in Drawer with a submit button.

    expand codeexpand code
    Multi-level drawer

    Open a new drawer on top of an existing drawer to handle multi branch tasks.

    expand codeexpand code
    Custom Placement

    The Drawer can appear from any edge of the screen.

    expand codeexpand code
    Render in current dom

    Render in current dom. custom container, check getContainer.

    Note: style and className props are moved to Drawer panel in v5 which is aligned with Modal component. Original style and className props are replaced by rootStyle and rootClassName.

    expand codeexpand code
    Preview drawer

    Use Drawer to quickly preview details of an object, such as those in a list.

    expand codeexpand code
    Preset size

    The default width (or height) of Drawer is 378px, and there is a preset large size 736px.

    expand codeexpand code

    API

    Common props ref:Common props

    🚨 Note: v5 use rootClassName & rootStyle to config wrapper style instead of className & style in v4 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)-
    bodyStyleStyle of the drawer content partCSSProperties-
    classNameConfig Drawer Panel className. Use rootClassName if want to config top dom stylestring-
    closeIconCustom close icon. 5.7.0: close button will be hidden when setting to null or falseboolean | ReactNode<CloseOutlined />
    contentWrapperStyleStyle of the drawer wrapper of content partCSSProperties-
    destroyOnCloseWhether to unmount child components on closing drawer or notbooleanfalse
    extraExtra actions area at cornerReactNode-4.17.0
    footerThe footer for DrawerReactNode-
    footerStyleStyle of the drawer footer partCSSProperties-
    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
    maskStyleStyle for Drawer's mask elementCSSProperties{}
    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-
    sizepreset size of drawer, default 378px and large 736px'default' | 'large''default'4.17.0
    titleThe title for DrawerReactNode-
    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)-

    Design Token

    Component Token

    Global Token

    Render in this
    • Lily

      Progresser XTech
      • View Profile
    • Lily

      Progresser XTech
      • View Profile