Menu

Designer doc
Note that Menu is different from Select. Menu mainly contains set of actions and doesn’t hold any value (except for menu item checkbox and radio). On the other hand, Select mainly focuses on the value that it holds.

Example

Basic Usage
View code
You can also use IconButton as menu button. Below also shows how you can create menu link for an item.
View code
You can specify either color or colorType prop to customize the color of MenuItem.
View code
You can render nested menu using SubMenu component. You can use ArrowRight or Enter to expand it; and ArrowLeft or Escape to collapse. Below is an example of Adobe Illustrator’s Effect menu.
View code
You can customize SubMenu styles to be more compact and reduce the animation. Below example also demonstrates how you can SubMenu that only opens when it is clicked.
View code

Accessibility

Aria attributes follow WAI-ARIA Menu and Menu Button Authoring Practice.
Menu can be opened using ArrowDown and ArrowUp keys. They respectively auto focus on first and last item. Each item are navigatable through ArrowDown and ArrowUp keys. Pressing Escape will close the menu.
For SubMenu, additional handler ArrowRight and ArrowLeft are added to open and close the submenu.

References

API

Prop nameTypeDefaultDescription
activeboolean
arrowArrowProps
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
buttonReactElement<BaseButtonProps, any>
containerHTMLElementconfigs.getPortalContainer('Menu', 'container')
immediateboolean
initialActiveboolean
offset[number, number][0, 1]
onActiveChange(active: boolean) => void
placement"left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "left-start" | "left-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end"
popperOptionsPopperPopperOptions
Options for Popper.js instance
popperUpdateKeystring
springConfigPartial<AnimationConfig>{ tension: 720, mass: 0.5 }
Prop nameTypeDefaultDescription
colorstring
colorTypeColorTypes
secondaryColorstring
secondaryColorTypeColorTypes
sizestring | number16
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
closeOnClickbooleantrue
colorTypeColorTypes
disabledboolean
Equivalent to button's disabled property.
indexnumber
keyboardClickKeysstring[]
onBlurFocusEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
Prop nameTypeDefaultDescription
activeboolean
arrowArrowProps
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
buttonPropsMenuItemProps & { ref?: Ref<HTMLDivElement>; }
containerHTMLElementconfigs.getPortalContainer('SubMenu', 'container')
disableScrollLockboolean
immediateboolean
indexnumber
initialActiveboolean
labelReactNode
offset[number, number][-1, 0]
onActiveChange(active: boolean) => void
placement"left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "left-start" | "left-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end"right-start
popperOptionsPopperPopperOptions
Options for Popper.js instance
popperUpdateKeystring
springConfigPartial<AnimationConfig>{ tension: 720, mass: 0.5 }
    Example
    Example
    Basic Usage
    Basic Usage
    MenuItem Colors
    MenuItem Colors
    Submenu
    Submenu
    Accessibility
    Accessibility
    References
    References
    API
    API
    Menu
    Menu
    MenuArrow
    MenuArrow
    MenuItem
    MenuItem
    SubMenu
    SubMenu
Coral is a thoroughly developed design system widely adopted by developers and designers for creating beautiful and user-friendly Sea internal products.

Copyright © 2018-2025 Sea Labs