Conversation
Dependency Compatibility Matrix
|
850a1a3 to
270f57d
Compare
e9e7b87 to
6f45c09
Compare
|
🐥 |
|
🐥 |
|
🐥 |
|
🐥 |
| componentMenu.menuSection; | ||
| export const menuSectionHeaderStyles = ( | ||
| theme: MenuSectionTheme, | ||
| { size }: Required<Pick<MenuSectionProps, 'size'>>, |
Contributor
There was a problem hiding this comment.
Nice, will copy this in other places
andrewHEguardian
approved these changes
Mar 12, 2026
Contributor
andrewHEguardian
left a comment
There was a problem hiding this comment.
This looks great, have already tried it out in #25!
dc22a45 to
9da0fef
Compare
9b000d4 to
12ea837
Compare
9da0fef to
9ed1a9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Menucomponent and sub-components, based on the react ariaMenusemanticshadow property to design system.gitignoreany playwright testsMenu
A dropdown menu component built on React Aria.
The
Menucomponent combines a trigger element with a popover containingMenuItem,MenuSection, andMenuSeparatorsub-components.It supports single and multiple selection modes, icons, descriptions, keyboard navigation, and full accessibility out of the box.
When to use
MenuSectionwith an optional headerPeer dependencies
@emotion/reactreactreact-domtypescriptreact-aria-components@react-aria/focusSee the
peerDependenciessection ofpackage.jsonfor compatible versions.See custom component build for usage without React/Emotion.
Example usage
Components
The
Menucomponent is composed of several sub-components. Only the components listed below are valid direct children ofMenuandMenuSection.Menu
Required
The root component. Wraps a
MenuToggleand a popover containingMenuSection,MenuItem, andMenuSeparatorcomponents. Manages the open/close state of the popover and provides context for size and selection state.childrenReact.ReactNodeMenuToggle,MenuItem,MenuSection, orMenuSeparatorcomponents.size'sm' | 'md''md'popoverPropsOmit<PopoverProps, 'children' | 'size'>Popover, e.g.offset,placement.menuTriggerPropsOmit<MenuTriggerProps, 'children'>MenuTrigger, e.g.isOpento control open state.themePartial<MenuTheme>cssOverridesSerializedStyles<menu>element.classNamestringMenualso accepts all props from the underlying React AriaMenucomponent.MenuToggle
Required
Wraps the component used to toggle the menu open/closed state. Can be a form of Button/Link or a custom trigger. Must be a direct child of
Menuand must contain exactly one interactive element.childrenReact.ReactNode<IconButton>.MenuSection
Groups
MenuItemcomponents into a labelled or unlabelled section. Supports single and multiple selection modes when aselectionModeis set so that eachMenuItemwithin the section renders the appropriate selection indicator (checkbox or radio button) automatically.childrenReact.ReactNodeMenuItemcomponents.namestringsize'sm' | 'md''md'Menu, no need to pass manually.selectionMode'none' | 'single' | 'multiple''none'defaultSelectedKeysIterable<Key>selectedKeysIterable<Key>onSelectionChange.onSelectionChange(keys: Selection) => voidthemePartial<MenuSectionTheme>cssOverridesSerializedStylesclassNamestringMenuSectionalso accepts all props from the underlying React AriaMenuSectioncomponent.MenuItem
A single interactive item within a
MenuSection. Renders a label with optional icon, description, and aside content. When the parentMenuSectionhas aselectionMode, theiconprop is ignored and a selection indicator is rendered instead.labelReact.ReactNodeidKeyMenuSectionhas aselectionMode.descriptionReact.ReactNodeasideReact.ReactNode<Keyboard>fromreact-aria-components.iconstring | SVGElementselectionModeis set on the parent section.size'sm' | 'md''md'Menu, no need to pass manually.textValuestringlabelwhen it is a string.themePartial<MenuItemTheme>cssOverridesSerializedStylesclassNamestringMenuItemalso accepts all props from the underlying React AriaMenuItemcomponent.MenuSeparator
A horizontal rule for visually separating groups at the top level of a
Menu(betweenMenuSectioncomponents or standaloneMenuItemcomponents).themePartial<MenuSeparatorTheme>cssOverridesSerializedStylesclassNamestringCustomisation
We recommend using the Menu component as provided, but individual sub-components can be customised using their
themeorcssOverridesprops as needed.Custom theme
The
themeprop allows you to override specific design tokens on any component, using theComponentThemetype, or individual sub-component themes likeMenuTheme,MenuItemThemeetc.CSS overrides
The
cssOverridesprop allows you to pass custom CSS to any component:Custom Component Build
If you're not using React/Emotion, you can create a custom Menu component using the styles defined in the
MenuThemetype.You will however be responsible for any additional functionality on top of the styles, for example accessibility, focus management, interaction states etc.