Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MenuBarContext

internal
remarks

@since 5.0.0

Hierarchy

Index

Properties

activeId: string

This is the current DOM id for the MenuButton or MenuItemButton this is currently visible within the MenuBar. If the MenuBar behavior has not been enabled or no Menu are visible, this will be an empty string;

animatedOnce: boolean

Boolean if at least one menu has finished the enter animation. This is used to disable repeating the enter animation once the user is in hover mode since it is distracting to have to wait 0.2ms each time a new menu gains visibility.

hoverTimeout?: number

When this is provided and a number greater than 0, this will allow the menus to become visible on hover without clicking a MenuItemButton beforehand. Instead, hovering over a MenuItemButton for this time in milliseconds will display the Menu.

menubar: boolean

Boolean if the MenuBar functionality is enabled.

menuitem: boolean

This isn't tied directly to a MenuBar, but this is used to determine if there is a parent Menu so the DropdownMenu can be rendered as a MenuItemButton instead of a MenuButton.

root: boolean

Boolean if the MenuBar is the top-most MenuBar. This is just used so that the top-most DropdownMenu can render as a MenuItemButton instead of a MenuButton while maintaining the dropdown icon and keyboard behavior of a MenuButton.

setActiveId: Dispatch<SetStateAction<string>>

This is used to manually set the activeId based on menu visibility.

setAnimatedOnce: Dispatch<SetStateAction<boolean>>

This should be called with the menu's onEntered option so that the animatedOnce flag can be set to true. Once the activeId becomes an empty string (no visible menus), this should be called again with false so that the menu animations are visible.

Generated using TypeDoc