드롭다운 메뉴
드롭다운 메뉴 (Dropdown Menu)
드롭다운 메뉴는 화면의 공간을 절약하면서 상황에 맞는 액션과 옵션을 표시하는 탐색 컴포넌트예요. 각 항목은 링크나 액션으로 사용할 수 있고, 중첩된 하위 메뉴나 다중/단일 선택에도 활용할 수 있어요.
출처: 문서
본문
DropdownItem 컴포넌트
드롭다운 아이템은 드롭다운 메뉴에 항목(item)들을 채워 넣는 역할을 해요. 링크나 액션에 사용하며, 모든 아이템은 반드시 DropdownItemGroup 안에 있어야 해요. 중첩된 하위 메뉴의 트리거(trigger)로도 사용할 수 있답니다.
- 키워드: dropdown, menu, item, action, link, menuitem
- 카테고리: navigation
- 상태: general-availability
예시
import IconButton from '@atlaskit/button/icon/button';
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
const Examples = (): React.JSX.Element => (
<>
<DropdownMenu
shouldRenderToParent
trigger={({ triggerRef, ...props }) => (
<IconButton ref={triggerRef} {...props} icon={MoreIcon} label="More" />
)}
>
<DropdownItemGroup>
<DropdownItem href="/dashboard">Dashboard</DropdownItem>
<DropdownItem>Create</DropdownItem>
<DropdownItem>Delete</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
<DropdownMenu shouldRenderToParent trigger="Actions">
<DropdownItemGroup>
<DropdownItem>Export</DropdownItem>
<DropdownItem>Share</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
aria-haspopup |
boolean | "dialog" |
An optional boolean value used to indicate if the dropdown item has popup or not |
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Primary content for the item (required) |
component |
ComponentClass<PropsWithChildren<CustomItemComponentProps>, any> | FunctionComponent<PropsWithChildren<CustomItemComponentProps>> |
Custom component to render as an item |
description |
string | global.JSX.Element |
Description of the item |
elemAfter |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Element to render after the item text |
elemBefore |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Element to render before the item text |
href |
string |
Link to another page |
isDisabled |
boolean |
Makes the element appear disabled |
isSelected |
boolean |
Makes the element appear selected |
onClick |
(e: MouseEvent<Element, globalThis.MouseEvent> | KeyboardEvent<Element>) => void |
Event that is triggered when the element is clicked |
rel |
string |
The relationship of the linked URL as space-separated link types |
returnFocusRef |
RefObject<HTMLElement> |
If ref is passed, focus returns to that specific ref element after dropdown item clicked |
role |
string |
An optional string value that specifies the role of the dropdown item |
shouldDescriptionWrap |
boolean |
When true the description of the item will wrap multiple lines if it exceeds the width of the dropdown menu |
shouldTitleWrap |
boolean |
When true the title of the item will wrap multiple lines if it exceeds the width of the dropdown menu |
target |
string |
Where to display the linked URL, |
| see [anchor information](https://developer | ||
title |
string |
Adds a title attribute to the root item element |
사용 지침
- DropdownMenu 안에서 DropdownItemGroup과 함께 사용해요 (필수 부모 요소)
- 링크(href)나 액션(onClick)에 사용하세요. 액션에는 동사를, 링크에는 명사를 쓰고, 관사는 생략하며, 항목당 한 줄로 작성해요
- 중첩된 하위 메뉴의 경우 트리거로 사용할 수 있어요 (triggerRef와 trigger props를 전달하고, chevron 같은 elemAfter를 사용하세요). 최대 두 단계까지만 유지해요
콘텐츠 지침
- 명확하고 설명적인 메뉴 아이템 라벨을 사용해요
- 메뉴 아이템 텍스트를 간결하게 유지해요
- 메뉴 아이템 전체에서 일관된 용어를 사용해요
접근성 지침
- 잘림(truncation)을 피하세요 — 최대 너비가 라벨을 잘라내지 않도록 해요
- 화살표 키를 이용한 키보드 탐색을 보장해요
DropdownItemGroup 컴포넌트
드롭다운 메뉴 아이템을 감싸는 요소예요. 관련 항목들을 그룹으로 묶을 때 사용하며, 선택적인 짧은 대문자 제목(예: "Edit page", "Tools")으로 섹션을 구분할 수 있어요.
- 키워드: dropdown, menu, group, section, title
- 카테고리: navigation
- 상태: general-availability
예시
import IconButton from '@atlaskit/button/icon/button';
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
const Examples = (): React.JSX.Element => (
<>
<DropdownMenu
shouldRenderToParent
trigger={({ triggerRef, ...props }) => (
<IconButton ref={triggerRef} {...props} icon={MoreIcon} label="More" />
)}
>
<DropdownItemGroup>
<DropdownItem href="/dashboard">Dashboard</DropdownItem>
<DropdownItem>Create</DropdownItem>
<DropdownItem>Delete</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
<DropdownMenu shouldRenderToParent trigger="Actions">
<DropdownItemGroup>
<DropdownItem>Export</DropdownItem>
<DropdownItem>Share</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Children of the section (required) |
hasSeparator |
boolean |
Use this to render a border at the top of the section |
id |
string |
Unique identifier for the element |
isList |
boolean |
If your menu contains a list, use this to add <ul> and <li> tags around the items |
isScrollable |
boolean |
Enables scrolling within the section |
label |
string |
Provide an accessible label for the section via aria-label for assistive technology |
title |
string |
The text passed into the internal HeadingItem |
titleId |
string |
ID referenced by the menu group wrapper's aria-labelledby attribute |
사용 지침
- DropdownMenu 안에서 관련 항목들을 그룹화할 때 사용해요
- 그룹을 설명하는 짧고 대문자로 된 제목을 사용해요
- 중첩 메뉴는 최대 두 단계까지만 사용해요
콘텐츠 지침
- 관련 액션들을 논리적으로 그룹화해요
- 메뉴 아이템 전체에서 일관된 용어를 사용해요
접근성 지침
- 명확한 그룹 제목을 제공해요
- 중첩 메뉴는 최대 두 단계까지만 사용해요
DropdownItemCheckbox 컴포넌트
체크박스 선택 기능이 있는 드롭다운 메뉴 아이템이에요. 목록에서 여러 개를 선택할 때 사용해요 (예: 상태 필터, 표시/숨김 토글).
- 키워드: dropdown, menu, checkbox, multi-select, toggle
- 카테고리: navigation
- 상태: general-availability
예시
import IconButton from '@atlaskit/button/icon/button';
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
const Examples = (): React.JSX.Element => (
<>
<DropdownMenu
shouldRenderToParent
trigger={({ triggerRef, ...props }) => (
<IconButton ref={triggerRef} {...props} icon={MoreIcon} label="More" />
)}
>
<DropdownItemGroup>
<DropdownItem href="/dashboard">Dashboard</DropdownItem>
<DropdownItem>Create</DropdownItem>
<DropdownItem>Delete</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
<DropdownMenu shouldRenderToParent trigger="Actions">
<DropdownItemGroup>
<DropdownItem>Export</DropdownItem>
<DropdownItem>Share</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Primary content for the item (required) |
defaultSelected |
boolean |
Sets whether the checkbox begins selected |
description |
string | JSX.Element |
Description of the item |
id |
string |
Unique id of a checkbox (required) |
isDisabled |
boolean |
Makes the checkbox appear disabled as well as removing interactivity |
isSelected |
boolean |
Sets whether the checkbox is checked or unchecked |
onClick |
(e: React.MouseEvent<Element, globalThis.MouseEvent> | React.KeyboardEvent<Element>) => void |
Event that is triggered when the checkbox is clicked |
shouldDescriptionWrap |
boolean |
When true the description of the item will wrap multiple lines if it's long enough |
shouldTitleWrap |
boolean |
When true the title of the item will wrap multiple lines if it's long enough |
title |
string |
Adds a title attribute to the root item element |
사용 지침
- DropdownItemCheckboxGroup과 함께 사용하고, isSelected와 onClick으로 선택을 제어해요
- 목록에서 여러 개를 선택하거나 토글 용도로 사용해요 (예: 카테고리, 열 표시 여부)
- 관련 체크박스들을 그룹으로 묶고, DropdownItemCheckboxGroup에 짧은 대문자 제목을 사용해요
콘텐츠 지침
- 명확하고 설명적인 라벨을 사용해요
- 메뉴 아이템 텍스트를 간결하게 유지해요
접근성 지침
- 키보드 탐색과 명확한 선택 상태를 보장해요
- 적절한 ARIA 속성을 사용해요
DropdownItemCheckboxGroup 컴포넌트
드롭다운 메뉴 안에서 다중 선택 옵션을 위해 DropdownItemCheckbox 컴포넌트들을 그룹으로 묶어줘요.
- 키워드: dropdown, menu, checkbox, group, multi-select
- 카테고리: navigation
- 상태: general-availability
예시
import React, { useState } from 'react';
import DropdownItemCheckbox from '@atlaskit/dropdown-menu/dropdown-item-checkbox';
import DropdownItemCheckboxGroup from '@atlaskit/dropdown-menu/dropdown-item-checkbox-group';
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
const DropdownItemCheckboxExample = (): React.JSX.Element => {
const [checked, setChecked] = useState<Record<string, boolean>>({
todo: true,
});
const toggle = (name: string) => {
setChecked((prev) => ({
...prev,
[name]: !prev[name],
}));
};
return (
<DropdownMenu trigger="Status" shouldRenderToParent>
<DropdownItemCheckboxGroup title="Categories" id="actions">
<DropdownItemCheckbox id="todo" onClick={() => toggle('todo')} isSelected={checked['todo']}>
To do
</DropdownItemCheckbox>
<DropdownItemCheckbox
id="inprogress"
onClick={() => toggle('inprogress')}
isSelected={checked['inprogress']}
>
In progress
</DropdownItemCheckbox>
<DropdownItemCheckbox id="done" onClick={() => toggle('done')} isSelected={checked['done']}>
Done
</DropdownItemCheckbox>
</DropdownItemCheckboxGroup>
</DropdownMenu>
);
};
export default DropdownItemCheckboxExample;
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Children of the section (required) |
hasSeparator |
boolean |
Use this to render a border at the top of the section |
id |
string |
Unique identifier for the checkbox group (required) |
isList |
boolean |
If your menu contains a list, use this to add <ul> and <li> tags around the items |
isScrollable |
boolean |
Enables scrolling within the section |
label |
string |
Provide an accessible label for the section via aria-label for assistive technology |
title |
string |
The text passed into the internal HeadingItem |
titleId |
string |
ID referenced by the menu group wrapper's aria-labelledby attribute |
사용 지침
- 관련 DropdownItemCheckbox 항목들을 그룹으로 묶을 때 사용해요
- 목록에서 여러 개를 선택할 때 사용해요
콘텐츠 지침
- 관련 체크박스들을 논리적으로 그룹화해요
- 일관된 용어를 사용해요
DropdownItemRadio 컴포넌트
라디오 선택 기능이 있는 드롭다운 메뉴 아이템이에요. 짧은 목록에서 하나를 선택할 때 사용해요 (예: 보기 모드, 정렬 순서).
- 키워드: dropdown, menu, radio, single-select, choice
- 카테고리: navigation
- 상태: general-availability
예시
import IconButton from '@atlaskit/button/icon/button';
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
const Examples = (): React.JSX.Element => (
<>
<DropdownMenu
shouldRenderToParent
trigger={({ triggerRef, ...props }) => (
<IconButton ref={triggerRef} {...props} icon={MoreIcon} label="More" />
)}
>
<DropdownItemGroup>
<DropdownItem href="/dashboard">Dashboard</DropdownItem>
<DropdownItem>Create</DropdownItem>
<DropdownItem>Delete</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
<DropdownMenu shouldRenderToParent trigger="Actions">
<DropdownItemGroup>
<DropdownItem>Export</DropdownItem>
<DropdownItem>Share</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Primary content for the item (required) |
defaultSelected |
boolean |
Sets whether the checkbox begins selected |
description |
string | JSX.Element |
Description of the item |
id |
string |
Unique ID of the checkbox (required) |
isDisabled |
boolean |
Makes the checkbox appear disabled as well as removing interactivity |
isSelected |
boolean |
Sets whether the checkbox is checked or unchecked |
onClick |
(e: React.MouseEvent<Element, globalThis.MouseEvent> | React.KeyboardEvent<Element>) => void |
Event that is triggered when the checkbox is clicked |
shouldDescriptionWrap |
boolean |
When true the description of the item will wrap multiple lines if it's long enough |
shouldTitleWrap |
boolean |
When true the title of the item will wrap multiple lines if it's long enough |
title |
string |
Adds a title attribute to the root item element |
사용 지침
- DropdownItemRadioGroup과 함께 사용하고, isSelected와 onClick으로 선택을 제어해요
- 짧은 목록에서 하나를 선택할 때 사용해요 (예: views, density)
- 관련 라디오 항목들을 그룹으로 묶고, DropdownItemRadioGroup에 짧은 대문자 제목을 사용해요
콘텐츠 지침
- 명확하고 설명적인 라벨을 사용해요
- 메뉴 아이템 텍스트를 간결하게 유지해요
접근성 지침
- 키보드 탐색과 명확한 선택 상태를 보장해요
- 적절한 ARIA 속성을 사용해요
DropdownItemRadioGroup 컴포넌트
드롭다운 메뉴 안에서 단일 선택 옵션을 위해 DropdownItemRadio 컴포넌트들을 그룹으로 묶어줘요.
- 키워드: dropdown, menu, radio, group, single-select
- 카테고리: navigation
- 상태: general-availability
예시
import React, { useState } from 'react';
import DropdownItemRadio from '@atlaskit/dropdown-menu/dropdown-item-radio';
import DropdownItemRadioGroup from '@atlaskit/dropdown-menu/dropdown-item-radio-group';
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
const DropdownItemRadioExample = (): React.JSX.Element => {
const [selected, setSelected] = useState<string>('detail');
return (
<DropdownMenu trigger="Views" shouldRenderToParent>
<DropdownItemRadioGroup title="Views" id="actions">
<DropdownItemRadio
id="detail"
onClick={() => setSelected('detail')}
isSelected={selected === 'detail'}
>
Detail view
</DropdownItemRadio>
<DropdownItemRadio
id="list"
onClick={() => setSelected('list')}
isSelected={selected === 'list'}
>
List view
</DropdownItemRadio>
</DropdownItemRadioGroup>
</DropdownMenu>
);
};
export default DropdownItemRadioExample;
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Children of the section (required) |
hasSeparator |
boolean |
Use this to render a border at the top of the section |
id |
string |
(required) |
isList |
boolean |
If your menu contains a list, use this to add <ul> and <li> tags around the items |
isScrollable |
boolean |
Enables scrolling within the section |
label |
string |
Provide an accessible label for the section via aria-label for assistive technology |
title |
string |
The text passed into the internal HeadingItem |
titleId |
string |
ID referenced by the menu group wrapper's aria-labelledby attribute |
사용 지침
- 관련 DropdownItemRadio 항목들을 그룹으로 묶을 때 사용해요
- 짧은 목록에서 하나를 선택할 때 사용해요
콘텐츠 지침
- 관련 라디오 항목들을 논리적으로 그룹화해요
- 일관된 용어를 사용해요
DropdownMenu 컴포넌트
상황에 맞는 액션과 옵션을 표시하는 드롭다운 메뉴 컴포넌트예요.
- 키워드: dropdown, menu, overflow, actions, options, popup, contextual
- 카테고리: navigation
- 상태: general-availability
예시
import IconButton from '@atlaskit/button/icon/button';
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
const Examples = (): React.JSX.Element => (
<>
<DropdownMenu
shouldRenderToParent
trigger={({ triggerRef, ...props }) => (
<IconButton ref={triggerRef} {...props} icon={MoreIcon} label="More" />
)}
>
<DropdownItemGroup>
<DropdownItem href="/dashboard">Dashboard</DropdownItem>
<DropdownItem>Create</DropdownItem>
<DropdownItem>Delete</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
<DropdownMenu shouldRenderToParent trigger="Actions">
<DropdownItemGroup>
<DropdownItem>Export</DropdownItem>
<DropdownItem>Share</DropdownItem>
</DropdownItemGroup>
</DropdownMenu>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
appearance |
"default" | "tall" |
Controls the appearance of the menu |
autoFocus |
boolean |
Controls if the first menu item receives focus when menu is opened |
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
Content that will be rendered inside the layer element |
defaultOpen |
boolean |
Controls the initial open state of the dropdown |
isLoading |
boolean |
If true, a spinner is rendered instead of the items |
isOpen |
boolean |
Controls the open state of the dropdown |
label |
string |
Provide an accessible label via aria-label for assistive technology |
menuLabel |
string |
Provide an accessible label for the menu element for assistive technology |
onOpenChange |
(args: OnOpenChangeArgs) => void |
Called when the menu should be open/closed |
placement |
"auto" | "auto-start" | "auto-end" | "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" |
Position of the menu |
returnFocusRef |
React.RefObject<HTMLElement> |
If ref is passed, focus returns to that specific ref element after dropdown dismissed |
shouldFitContainer |
boolean |
This fits the dropdown menu width to its parent's width |
shouldIgnoreCloseEvent |
(event: Event | React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => boolean |
Allows consumers to ignore specific close events, for example when an external overlay |
| should be treated as part of the dropdown interaction | ||
spacing |
"compact" | "cozy" |
Controls the spacing density of the menu |
statusLabel |
string |
Text to be used as status for assistive technologies |
trigger |
string | ((triggerButtonProps: CustomTriggerProps<T>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) |
Content that triggers the dropdown menu to open and close |
사용 지침
- 5~15개 항목에 사용해요. 탐색 또는 커맨드(선택 시 액션) 용도로 써요
- 잘림을 피하세요 — 최대 너비를 확인하고, 잘리는 라벨이 없도록 해요
- 중첩 메뉴는 최대 두 단계까지만 사용해요
- 모달 안에서는 올바른 포커스와 스크린 리더 동작을 위해 shouldRenderToParent를 사용해요
- 비활성화된 트리거는 지원하지 않아요 (Button a11y 참고)
- 검색/선택에는 Select, 목록에서 다중 선택에는 Checkbox, 짧은 단일 선택에는 Radio를 사용해요
콘텐츠 지침
- 논리적인 순서로 배치하고 (가장 많이 선택된 항목 먼저 등), 대문자 섹션 제목으로 그룹화해요
- 액션에는 동사를, 링크에는 명사를 쓰고, 관사는 생략하며, 항목당 한 줄로 작성해요
- 명확하고 설명적인 메뉴 아이템 라벨을 사용해요
- 메뉴 아이템 텍스트를 간결하게 유지해요
- 관련 액션들을 논리적으로 그룹화해요
- 메뉴 아이템 전체에서 일관된 용어를 사용해요
접근성 지침
- 잘림을 피하세요 — 최대 너비가 라벨을 잘라내지 않도록 해요
- 열려 있을 때 포커스를 잠그고, 키보드로 열면 첫 항목에 포커스가 가도록 해요
- 중첩 메뉴는 최대 두 단계까지만 사용해요
- 모달 안에서는 포커스와 음성 출력을 위해 shouldRenderToParent를 사용해요
- 드롭다운 트리거에 명확한 라벨을 제공해요
- 화살표 키를 이용한 키보드 탐색을 보장해요
- 적절한 ARIA 속성을 사용해요