I couldn't really figure out a nice way to have the type inferred
automatically based on parent menus, so this is the "best" way to allow
some type-safety and autocompletion I could think of for DropdownMenu
s.
All this type will do is make sure you don't apply both button specific props with menu item specific props at the same time but won't catch any errors around providing button props to a menuitem or menuitem props to a button.
Since the useMenu
hook was designed to work with react-md
components,
this is an object of props that should be passed to the Menu
component to get the correct menu functionality.
This allows the menu to be conditionally rendered as a Sheet
instead of a
menu.
false
- always render as a Menu
true
- always render as a Sheet
"phone"
- render as a sheet only when the AppSize is considered
phone (isPhone === true
).This component conditionally renders the MenuWidget with the
MenuKeyboardFocusProvider based on the visible
prop with a CSS
transition that can be configured.
This is just an internal component that handles rendering the button for a
DropdownMenu
with a conditional dropdown icon.
This component is used as an "action" within a Menu
/DropdownMenu
that
implements some keyboard focus behavior. This component should generally have
an onClick
event handler.
This is just an internal component that handles rendering a submenu as a
menuitem for a DropdownMenu
with a conditional dropdown icon.
If a menu or menubar contains more than one group of menuitemradio elements, or if the menu contains one group and other, unrelated menu items, authors SHOULD nest each set of related menuitemradio elements in an element using the group role, and authors SHOULD delimit the group from other menu items with an element using the separator role.
This is a wrapper for the ListItemLink component that allows for the
correct keyboard focus behavior within Menus. Just like the
ListItemLink, set a ListItemLinkProps.component prop to your
custom Link
if needed.
This component renders a <li role="separator">
with the divider styles. It
will also automatically render itself vertically instead of horizontally if
the menu is rendering horizontally.
This component implements the custom keyboard movement for a menu widget. The MenuKeyboardFocusProvider must be a parent component for this custom focus behavior to work.
Note: This is probably an internal only component since the Menu has more functionality and includes this component.
This component is a preset for creating dropdown menus using the
useMenu hook which provides the visibility behavior and other
functionality for menus. This will render as a <Button>
by default but can
be rendered as a <MenuItem>
by existing as a child of another
DropdownMenu
.
Most of the top-level props will be passed directly to the Button
or
MenuItem
components with the exception for the children
. The children for
the Button
or MenuItem
can be set with the buttonChildren
prop since
the main children
should be the Menu
's children.
The MenuBar
component is used to link child DropdownGroup
s' visibility
together and following the specs for a
menubar.
This component implements the keyboard focus behavior for the MenuBar
component and probably shouldn't be used externally.
Note: This will always merge values with any parent
MenuConfigurationProvider
s.
This component conditionally renders either the Menu
or MenuSheet
component based on the current menu configuration.
Implements a Menu
using the Sheet
component that probably shouldn't
really be used externally.
This hook controls the visibility and positioning for a context menu.
This hook provides all the functionality for a menu to:
Menu
's visibility when the MenuButton
or MenuItemButton
has been clickedMenu
when an element outside of the Menu
has been clickedMenu
when the Escape
or Tab
key has been pressedMenu
element when it gains visibilityMenuButton
or MenuItemButton
when the menu loses visibilityMenu
when the ArrowRight
key is pressed for a vertical
MenuItemButton
Menu
when the ArrowDown
key is pressed for a horizontal
MenuItemButton
Menu
when the ArrowRight
key is pressed in a vertical submenuMenu
when the ArrowDown
key is pressed in a horizontal
submenuMenu
if the page is scrolled while the Menu
is
visibleMenu
if the page is resized while the Menu
is
visibleDropdownMenu
with keyboard movement
when inside of a MenuBar
DropdownMenu
when the mouse
hovers over a MenuItemButton
with a parent MenuBar
that has been
activatedMenu
based on a parent MenuBar
's activeId
This hook will probably never need to be used externally since it has been
integrated into the DropdownMenu
component and useContextMenu
hook.
This is probably just an internal only hook that allows you to get the MenuConfigurationContext with optional overrides.
An object of MenuConfiguration that would override
the inherited context values if they are not undefined
.
the MenuConfigurationContext with any overrides that were provided.
This hook allows you control the visibility of a parent menu. The main use-case for this hook is adding a custom sheet header/footer.
Generated using TypeDoc
@since 5.0.0