Skip to content
CraftDocs
GitHub
Home
Home
Changelog
What's New
Guide
Guide
Getting Started
Principles
Styling Components
Theme System
Foundations
All Tokens
Color
Elevation
Icons
Motion
Shape
Spacing
Typography
Libraries
Libraries
@xds/cli
@xds/core
Themes
Themes
Theme: daily
Default Theme
Theme: matcha
Neutral Theme
Components
Components
AppShell
AspectRatio
Avatar
Avatar
AvatarStatusDot
Badge
Banner
Breadcrumbs
BreadcrumbItem
Breadcrumbs
Button
Button
IconButton
ToggleButton
ToggleButtonGroup
Calendar
Card
Carousel
Chat
ChatComposer
ChatComposerDrawer
ChatComposerInput
ChatComposerTokenElement
ChatDictationButton
ChatLayout
ChatLayoutScrollButton
ChatMessage
ChatMessageBubble
ChatMessageList
ChatMessageMetadata
ChatSendButton
ChatSystemMessage
ChatTokenizedText
ChatToolCalls
Checkbox
CheckboxInput
CheckboxList
CheckboxListItem
ClickableCard
Code
CodeBlock
Collapsible
Collapsible
CollapsibleGroup
useXDSCollapsible
CommandPalette
CommandPalette
CommandPaletteEmpty
CommandPaletteFooter
CommandPaletteGroup
CommandPaletteInput
CommandPaletteItem
CommandPaletteList
DateInput
Dialog
AlertDialog
Dialog
DialogHeader
useXDSImperativeAlertDialog
useXDSImperativeDialog
Divider
DropdownMenu
DropdownMenu
DropdownMenuDivider
DropdownMenuItem
DropdownMenuItemData
DropdownMenuSection
EmptyState
Field
Field
FieldLabel
FieldStatus
Heading
HoverCard
Icon
Kbd
Layout
Center
FormLayout
Grid
GridSpan
HStack
Layout
LayoutContainer
LayoutContent
LayoutFooter
LayoutHeader
LayoutPanel
Section
StackItem
VStack
Link
List
List
ListItem
Markdown
MetadataList
MetadataList
MetadataListItem
MobileNav
MoreMenu
NavIcon
NavMenuItem
NumberInput
OverflowList
Pagination
Popover
PowerSearch
ProgressBar
Radio
RadioList
RadioListItem
Resizable
ResizeHandle
useXDSResizable
SegmentedControl
SegmentedControl
SegmentedControlItem
SelectableCard
Selector
MultiSelector
Selector
SelectorOption
SideNav
SideNav
SideNavCollapseButton
SideNavHeading
SideNavItem
SideNavSection
Skeleton
Slider
Spinner
StatusDot
Switch
Table
BaseTable
Table
TableCell
TableHeaderCell
TableRow
useXDSTableColumnSettings
useXDSTablePagination
useXDSTableSelection
useXDSTableSelectionState
useXDSTableSortable
Tabs
Tab
TabList
TabMenu
Text
TextArea
TextInput
Thumbnail
TimeInput
Timestamp
Toast
Toast
useXDSToast
Token
Tokenizer
Toolbar
Tooltip
TopNav
TopNav
TopNavHeading
TopNavItem
TopNavMegaMenu
TopNavMegaMenuFeaturedCard
TopNavMegaMenuItem
TopNavMenu
TreeList
Typeahead
BaseTypeahead
Typeahead
TypeaheadItem
useXDSHoverCard
useXDSPopover
useXDSTooltip
Utilities
Utilities
LinkProvider
MediaTheme
SyntaxTheme
Theme
useClickableContainer
useEntryAnimation
useFocusTrap
useGridFocus
useImageMode
useInputContainer
useListFocus
useMediaQuery
useOverflow
useScrollLock
useScrollOverflow
useXDSLayer
useXDSStreamingText
Terms of UsePrivacy Policy
Type to search
↑↓Navigate↵SelectEscClose
DropdownMenu@xds/core v0.0.13 · XDSDropdownMenu

Usage

A dropdown menu that displays a list of actionable items in a popup triggered by a button. Use to present action options as a next step in a process, or to offer contextual actions without cluttering the interface.
ts
import {XDSDropdownMenu} from '@xds/core/DropdownMenu'

Best practices

GuidancePractices
DoKeep menu items concise and action-oriented so users can scan options quickly.
DoUse sections and dividers to group related actions when the menu has many items.
Don'tUse a DropdownMenu for navigation — use a navigation component instead.
Don'tPlace more than 10–12 items in a single menu without grouping them into sections.

Sub-components

DropdownMenu is a compound component with 5 sub-components.

XDSDropdownMenu

Main dropdown menu component with a trigger button and popup item list.
PropTypeDescription
itemsrequired
XDSDropdownMenuOption[]Menu items, dividers, or sections to display in the popup.
button
XDSDropdownMenuButtonProps (default: { label: 'Menu' })Props for the trigger button (XDSButton props except onClick).
isMenuOpen
booleanControlled open state for the menu.
onOpenChange
(isOpen: boolean) => voidCallback fired when the open state changes.
menuWidth
number | stringCustom menu width; defaults to matching the trigger button width.
onClick
() => voidCallback fired when the trigger button is clicked.
hasChevron
boolean (default: true)Whether to show a chevron icon on the trigger button. Set to false for icon-only triggers.
children
(item: XDSDropdownMenuItemData) => ReactNodeCustom render function for each item in the list.

XDSDropdownMenuDivider

A visual divider that can be placed between items in the `items` array.
PropTypeDescription
typerequired
'divider'Discriminant value that identifies this entry as a divider.

XDSDropdownMenuItem

Helper component for custom item rendering with consistent styling.
PropTypeDescription
icon
XDSIconTypeIcon to display before the label. See `npx xds docs icons` for valid semantic names.
label
ReactNodePrimary label text.
description
ReactNodeSecondary description text displayed below the label.
children
ReactNodeAdditional content rendered after the label and description.
xstyle
StyleXStylesStyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.

XDSDropdownMenuItemData

Data shape for a single actionable menu item passed via the `items` prop.
PropTypeDescription
labelrequired
stringDisplay label for the item.
onClick
() => voidCallback fired when the item is selected.
isDisabled
boolean (default: false)Whether the item is disabled; disabled items are skipped during keyboard navigation.
icon
XDSIconTypeIcon to display before the item label. See `npx xds docs icons` for valid semantic names.

XDSDropdownMenuSection

A labeled group of items that can be placed in the `items` array.
PropTypeDescription
typerequired
'section'Discriminant value that identifies this entry as a section.
itemsrequired
XDSDropdownMenuItemData[]The actionable items that belong to this section.
title
stringOptional header text displayed above the section items.

Examples

Common configurations, variations, and states.
DropdownMenu — Actions
Action menu with dividers separating safe and destructive operations. Use for row-level actions on items like documents, projects, or records.
DropdownMenu — Icon Trigger
Overflow menu triggered by an icon-only button with no chevron or label text. Use for row-level actions in tables, cards, or lists where a text button would take too much space.
DropdownMenu — Disabled
Menu with selectively disabled items based on permissions. Use when some actions require higher privileges, like admin-only operations.
DropdownMenu — Sections
Menu items organized into titled sections for easy scanning. Use when you have 6+ actions that fall into distinct categories, like Create vs Manage.