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

Dropdown

드롭다운 목록입니다.
가져오기import{ Dropdown }from"antd";
소스components/dropdown
문서
이 페이지 수정변경 로그

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

언제 사용하나요?

선택할 수 있는 옵션이 여러 개 있을 경우, Dropdown으로 묶을 수 있습니다. 트리거 위에 마우스를 올리거나 클릭할 경우, 드롭다운 메뉴가 나타나고, 옵션을 선택하고 관련 작업을 실행할 수 있습니다.

예시

API

공통 속성 참조:공통 속성

Dropdown

프로퍼티설명타입기본값버전
arrow드롭다운 화살표 표시 여부boolean | { pointAtCenter: boolean }false
autoAdjustOverflow드롭다운이 화면에서 사라졌을 때 드롭다운 배치를 자동으로 조정할지 여부booleantrue5.2.0
autoFocus드롭다운이 열렸을 때 overlay 요소를 포커스합니다 Focus element in overlay when openedbooleanfalse4.21.0
disabled드롭다운 메뉴 비활성화 여부boolean-
destroyPopupOnHide숨겨졌을 때 드롭다운 파괴 여부booleanfalse
dropdownRender드롭다운 콘텐츠를 사용자 지정합니다(menus: ReactNode) => ReactNode-4.24.0
getPopupContainer드롭다운 메뉴의 컨테이너를 설정합니다. 기본적으로는 body 안에 div 요소를 만드는 것이지만, 스크롤 영역을 재설정하고 상대적인 위치를 변경할 수 있습니다. CodePen에서의 예시(triggerNode: HTMLElement) => HTMLElement() => document.body
menu메뉴 컴포넌트의 propsMenuProps-4.24.0
overlayClassName드롭다운 루트 요소의 클래스 이름string-
overlayStyle드롭다운 루트 요소의 스타일CSSProperties-
placement팝업 메뉴의 배치: bottom bottomLeft bottomRight top topLeft topRightstringbottomLeft
trigger드롭다운 동작을 실행하는 트리거 모드입니다. 마우스를 올리는 hover는 터치스크린에서 사용할 수 없다는 것을 주의하세요.Array<click|hover|contextMenu>[hover]
open드롭다운 메뉴가 현재 열려 있는지에 대한 여부입니다. 4.23.0 미만에서 visible을 사용합니다. (그 이유에 대해서)boolean-4.23.0
onOpenChangeopen 상태가 변경될 때 호출됩니다. 메뉴 요소 클릭으로 인해 사라졌을 경우, 트리거되지 않습니다. 4.23.0 미만에서 onVisibleChange을 사용합니다. (그 이유에 대해서)(open: boolean, info: { source: 'trigger' | 'menu' }) => void-info.source: 5.11.0

Dropdown.Button

Dropdown의 props와 동일합니다. 그리고 다음과 같은 props를 추가로 포함하고 있습니다.

프로퍼티설명타입기본값버전
buttonsRenderDropdown.Button 내부의 사용자 지정 버튼(buttons: ReactNode[]) => ReactNode[]-
loading버튼의 로딩 상태 설정boolean | { delay: number }false
danger버튼의 위험 상태 설정boolean-4.23.0
icon아이콘 (오른쪽에 표시됩니다.)ReactNode-
size버튼의 크기, Button과 동일stringdefault
type버튼의 유형, Button과 동일stringdefault
onClickButton과 동일: 왼쪽의 버튼을 클릭하면 호출됩니다.(event) => void-

Note

Dropdown의 자식 노드가 onMouseEnter, onMouseLeave, onFocus, onClick 이벤트를 허용하는지 확인해 주세요.

Design Token

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

토큰 이름설명타입기본값
paddingBlock드롭다운의 세로 안쪽 여백undefined | PaddingBlock<string | number>5
zIndexPopup드롭다운의 z-indexnumber1050

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

FAQ

Dropdown이 화면을 가로로 초과할 때 눌리는 것을 방지하려면 어떻게 해야 하나요?

width: max-content를 사용하여 해당 문제를 처리할 수 있습니다. #43025 참조.

기본

가장 기본적인 드롭다운 메뉴입니다.

codepen icon
External Link Icon
expand codeexpand code
배치

6개의 배치 위치를 지원합니다.

codepen icon
External Link Icon
expand codeexpand code
기타 요소

구분선과 비활성화된 메뉴 요소

codepen icon
External Link Icon
expand codeexpand code
트리거 모드

트리거 모드의 기본값은 hover이며, click으로 변경할 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
드롭다운 메뉴가 있는 버튼

왼쪽에는 버튼이 있고, 오른쪽에는 관련된 기능의 메뉴가 있습니다. 아이콘 속성을 설정하여 오른쪽 아이콘을 수정할 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
계단식 메뉴

메뉴에는 여러 단계가 있습니다.

codepen icon
External Link Icon
expand codeexpand code
추가 노드

단축어가 있는 드롭다운 메뉴입니다.

codepen icon
External Link Icon
expand codeexpand code
5.21.0
화살표

화살표를 표시할 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
중앙을 가리키는 화살표

arrow 속성을 { pointAtCenter: true }로 지정하면, 화살표가 대상 요소의 중앙을 가리키게 됩니다.

codepen icon
External Link Icon
expand codeexpand code
클릭 이벤트

메뉴 요소를 클릭하면 이벤트가 트리거되며, 요소의 키에 따라 다른 작업을 수행할 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
사용자 지정 드롭다운

dropdownRender를 통해 드롭다운 메뉴를 사용자 지정으로 변경합니다. 메뉴 콘텐츠가 필요하지 않은 경우, Popover 컴포넌트를 직접 사용하세요.

codepen icon
External Link Icon
expand codeexpand code
메뉴를 숨기는 방법

메뉴 요소를 클릭할 때 메뉴를 닫는 것이 기본값이며, 이 기능은 끌 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
바로 가기 메뉴

기본 트리거 모드는 hover이며, contextMenu로 트리거 모드를 변경할 수 있습니다. 팝업 메뉴 위치는 오른쪽 클릭 위치를 따릅니다.

codepen icon
External Link Icon
expand codeexpand code
로딩

Dropdown.Button에서 loading 속성을 설정하여 로딩 상태를 버튼에 추가로 보여 줄 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
선택 가능한 메뉴

menu에서 selectable 속성을 구성하여 선택 가능 기능을 활성화합니다.

codepen icon
External Link Icon
expand codeexpand code
Hover me
Hover me
Click me
Cascading menu
Hover me
Hover me, Click menu item
Hover me
Hover me
Right Click on here
Selectable