Garden 9 is now available.
The website has been updated to the latest major version. View previous versions
Skip to main content
Design
Components
Patterns
    • Introduction
      • Overview
    • Foundations
      • Bedrock CSS
      • Design tokens
      • Containers
      • Theming
      • Versions
    • Components
      • Accordion
      • Anchor
      • Avatar
      • Breadcrumbs
      • Buttons
      • Chrome
      • Code block
      • Color picker
      • Color swatch
      • Date picker
      • Draggable
      • Drawer
      • Forms
      • Grid
      • Loaders
      • Menu
      • Modal
      • Notification
      • Pagination
      • Pane
      • Sheet
      • Status indicator
      • Stepper
      • Table
      • Tabs
      • Tags
      • Tiles
      • Timeline
      • Tooltip
      • Tooltip dialog
      • Typography
      • Well
    Table of Contents
    • How to use it
      • Default
      • Button
      • Arrow
      • Danger
      • Disabled
      • Media items
      • Meta text
      • Grouped items
      • Nested
      • Placement
      • Size
    • Configuration
    • API
      • Menu
      • Item
      • ItemGroup
      • Separator

    Menu

    Menus help users choose items from a list.


    Table of Contents
    • How to use it
      • Default
      • Button
      • Arrow
      • Danger
      • Disabled
      • Media items
      • Meta text
      • Grouped items
      • Nested
      • Placement
      • Size
    • Configuration
    • API
      • Menu
      • Item
      • ItemGroup
      • Separator

    Used for this
    • To let users see and choose one thing from a list of items
    • To limit user selection within groups of items
    Not for this
    • To let users type or select options in a form, use Combobox instead
    • To move between views, use Tabs instead
    • To let users see and choose one thing from a list of parallel actions, use in combination with a Split button

    How to use it

    Default

    Display a list of menu items. Uses a default Garden Button internally.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Button

    Configure a custom menu trigger.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Arrow

    An arrow can be added to the Menu to give the user a sense of what element is triggering it.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Danger

    Use danger styling for Menu items that enable destructive action.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Disabled

    Items within a Menu can be disabled to prevent a user from interacting with them.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Media items

    Media elements add even more context to a Menu.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Meta text

    Meta text can also be paired with Menu items for additional clarity.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Grouped items

    Group items together if they are associated or to enable selection.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Nested

    Menus can contain nested levels for additional categorization of menu items.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Placement

    Menu placement can be oriented around a trigger element in different positions. The default placement is bottom-start. This example demonstrates the top placement. Optional fallbackPlacements can be set for fine-tuned repositioning control.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Size

    Can be default or compact in size. This reduces vertical padding on menu items.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Configuration

    • Name9.5.3•View source•View on npm
    • Installnpm install @zendeskgarden/react-dropdowns
    • Depsnpm install react react-dom styled-components @zendeskgarden/react-theming
    • Importimport { Item, ItemGroup, Menu, Separator } from '@zendeskgarden/react-dropdowns'

    API

    The Menu component follows this structure:

    <Menu>  <Item />  <Item />  <ItemGroup>    <Item />  </ItemGroup>  {/* etc. */}</Menu>

    Use Array.map to iterate over items.

    const ITEMS = [  { value: 'Sunflower' },  {    legend: 'More flowers',    items: [      { value: 'Violet' },      { value: 'Daisy' },    ]  }]
    <Menu>  {ITEMS.map(item =>    item.items ? (      <ItemGroup key={item.legend} legend={item.legend}>        {item.items.map(groupItem => (          <Item key={groupItem.value} {...groupItem} />        ))}      </ItemGroup>    ) : (      <Item key={item.value} {...item} />    )  )}</Menu>

    Match Item and ItemGroup prop signatures when using wrapper components.

    const ItemComponent = forwardRef((props, ref) => (  <Item {...props} ref={ref} />))
    const ItemGroupComponent = forwardRef((props, ref) => (  <ItemGroup {...props} ref={ref} />))
    <Menu>  <ItemGroupComponent legend="Flowers">    <ItemComponent value="Violet" />    <ItemComponent value="Sunflower" />    <ItemComponent value="Daisy" />  </ItemGroupComponent></Menu>

    Menu

    Extends HTMLAttributes<HTMLUListElement>

    A Menu manages placement, positioning and layout of its child Item components.

    Prop nameTypeDefaultDescription
    appendToNode
    Element | DocumentFragment

    Appends the menu to the element provided

    button
    string | ((props: IButtonProps & { ref: RefObject<HTMLButtonElement>; }) => ReactNode)
    Required

    Sets the menu button label or renders a provided trigger element

    buttonProps
    IButtonProps

    Provides additional props to the menu Button

    defaultExpanded
    boolean

    Determines default expansion in an uncontrolled menu

    defaultFocusedValue
    string

    Determines focused value on menu initialization

    fallbackPlacements
    ('end' | 'start' | 'top' | 'bottom' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'end-top' | 'end-bottom' | 'start-top' | 'start-bottom')[]

    Provides a list of acceptable fallback placements

    focusedValue
    string | null

    Sets the focused value in a controlled menu

    hasArrow
    boolean

    Attaches an arrow that points towards the menu trigger

    isCompact
    boolean

    Applies compact styling

    isExpanded
    boolean

    Sets the expansion in a controlled menu

    maxHeight
    string
    '400px'

    Sets the max-height of the menu

    minHeight
    string | null

    Sets the min-height of the menu

    onChange
    ((changes: { type: string; value?: string; isExpanded?: boolean; focusedValue?: string | null | undefined; selectedItems?: ISelectedItem[] | undefined; }) => void) | undefined

    Handles menu state changes

    Parameters
    changes.type

    The event type that triggered the change

    changes.isExpanded

    The updated menu expansion

    changes.selectedItems

    The updated selection values

    changes.focusedValue

    The updated focused value

    placement
    'end' | 'start' | 'auto' | 'top' | 'bottom' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'end-top' | 'end-bottom' | 'start-top' | 'start-bottom'
    'bottom-start'

    Adjusts the placement of the menu

    restoreFocus
    boolean

    Returns keyboard focus to the element that triggered the menu

    selectedItems
    ISelectedItem[]

    Sets the selected items in a controlled menu

    zIndex
    number
    1000

    Sets the z-index of the menu

    Item

    Extends LiHTMLAttributes<HTMLLIElement>

    Nest an Item within a Menu component. It requires a value prop.

    Prop nameTypeDefaultDescription
    icon
    ReactElement<any, string | JSXElementConstructor<any>>

    Accepts an icon to display

    isDisabled
    boolean

    Indicates that the item is not interactive

    isSelected
    boolean

    Determines the initial selection state for the item

    label
    string

    Sets the text label of the item (defaults to value)

    name
    string

    Associates the item in a radio item group

    type
    'next' | 'previous' | 'add' | 'danger'

    Determines the item type

    value
    string
    Required

    Sets the unique value that is returned upon selection

    Item.Meta

    Extends HTMLAttributes<HTMLDivElement>

    An ItemMeta provides additional information about a menu item. Nest it within an Item component.

    ItemGroup

    Extends LiHTMLAttributes<HTMLLIElement>

    Provides a semantic grouping to its child Item components. Optionally configures its Items as selectable.

    Prop nameTypeDefaultDescription
    content
    ReactNode

    Renders content for the item group (defaults to legend text)

    icon
    ReactElement<any, string | JSXElementConstructor<any>>

    Accepts an icon to display

    legend
    string

    Sets the text label of the item group

    type
    'checkbox' | 'radio'

    Configures the selection type for items within the group

    Separator

    Extends LiHTMLAttributes<HTMLLIElement>

    A semantic separator between Item components.

    Garden is the design system by Zendesk.
    BlogGitHubVersions
    © Zendesk 2025