Skip to content
fayeuiStatic / 0.1.0
LLMs
API / Static edition

@fayegram-ai/faye-ui/overlays/context-menu

Public exports and dependency-resolved component properties, with usage and rendering guidance.

Import

import { ContextMenu } from '@fayegram-ai/faye-ui/overlays/context-menu';

Usage and behavior guide · API JSON

This entry declares a client boundary. Follow the rendering guide for framework integration.

Public exports

NameKindResolved declaration type
ContextMenuvalueOmit<{ readonly Root: typeof MenuRoot; readonly SubmenuRoot: typeof Base.SubmenuRoot; readonly RadioGroup: NamedExoticComponent<Omit<MenuRadioGroupProps, "ref"> & RefAttributes<HTMLDivElement>>; readonly Trigger: { (input: MenuTriggerProps<unknown> & RefAttributes<HTMLElement> & { variants?: { readonly size?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefined; }): ReactElement<unknown, string | JSXElementConstructor<any>>; displayName: string; }; readonly Positioner: { (input: Omit<MenuPositionerProps, "ref"> & RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("packages/faye-ui/dist/contracts… (full type in API JSON)

ContextMenu

Public component; use the linked family guide for complete composition and behavior.

Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.

ContextMenu.SubmenuRoot

PropertyRequiredTypeMeaning
actionsRefNoReact.RefObject<MenuRootActions | null> | undefinedA ref to imperative actions. - unmount: Manually unmounts the menu. Call this after any externally controlled closing animation finishes. - close: When specified, the menu can be closed imperatively.
childrenNoReact.ReactNodeThe content of the submenu.
closeParentOnEscNoboolean | undefinedWhen in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu.
defaultOpenNoboolean | undefinedWhether the menu is initially open. To render a controlled menu, use the open prop instead.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
highlightItemOnHoverNoboolean | undefinedWhether moving the pointer over items should highlight them. Disabling this prop allows CSS :hover to be differentiated from the :focus (data-highlighted) state.
loopFocusNoboolean | undefinedWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
onOpenChangeNo((open: boolean, eventDetails: MenuSubmenuRoot.ChangeEventDetails) => void) | undefinedEvent handler called when the menu is opened or closed.
onOpenChangeCompleteNo((open: boolean) => void) | undefinedEvent handler called after any animations complete when the menu is opened or closed.
openNoboolean | undefinedWhether the menu is currently open.
orientationNoMenuRootOrientation | undefinedThe visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys.

ContextMenu.RadioGroup

PropertyRequiredTypeMeaning
childrenNoReactNodeThe content of the component.
classNameNostring | ((state: MenuRadioGroupState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
defaultValueNoanyThe uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
onValueChangeNo((value: any, eventDetails: MenuRadioGroup.ChangeEventDetails) => void) | undefinedFunction called when the selected value changes.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuRadioGroupState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuRadioGroupState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
valueNoanyThe controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.

ContextMenu.Positioner

PropertyRequiredTypeMeaning
alignNoAlign | undefinedHow to align the popup relative to the specified side. Submenus and menubars default to 'start'.
alignOffsetNonumber | OffsetFunction | undefinedAdditional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side.
anchorNoElement | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | null | undefinedAn element to position the popup against. By default, the popup will be positioned against the trigger.
arrowPaddingNonumber | undefinedMinimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
classNameNostring | ((state: MenuPositionerState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
collisionAvoidanceNoCollisionAvoidance | undefinedDetermines how to handle collisions when positioning the popup. side controls overflow on the preferred placement axis (top/bottom or left/right): - 'flip': keep the requested side when it fits; otherwise try the opposite side (top and bottom, or left and right). - 'shift': never change side; keep the requested side and move the popup within the clipping boundary so it stays visible. - 'none': do not correct side-axis overflow. align controls overflow on the alignment axis (start/center/end): - 'flip': keep side, but swap start and end when the requested alignment overflows. - 'shift': keep side and requested alignment, then nudge the popup along the alignment axis to fit. - 'none': do not correct alignment-axis overflow. fallbackAxisSide controls fallback behavior on the perpendicular axis when the preferred axis cannot fit: - 'start': allow perpendicular fallback and try the logical start side first (top before bottom, or left before right in LTR). - 'end': allow perpendicular fallback and try the logical end side first (bottom before top, or right before left in LTR). - 'none': do not fallback to the perpendicular axis. When side is 'shift', explicitly setting align only supports 'shift' or 'none'. If align is omitted, it defaults to 'flip'.
collisionBoundaryNoBoundary | undefinedAn element or a rectangle that delimits the area that the popup is confined to.
collisionPaddingNoPadding | undefinedAdditional space to maintain from the edge of the collision boundary.
disableAnchorTrackingNoboolean | undefinedWhether to disable the popup from tracking any layout shift of its positioning anchor.
positionMethodNo"absolute" | "fixed" | undefinedDetermines which CSS position property to use.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuPositionerState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
sideNoSide | undefinedWhich side of the anchor element to align the popup against. May automatically change to avoid collisions. Submenus and vertical menubars default to 'inline-end'.
sideOffsetNonumber | OffsetFunction | undefinedDistance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side.
stickyNoboolean | undefinedWhether to maintain the popup in the viewport after the anchor element was scrolled out of view.
styleNoCSSProperties | ((state: MenuPositionerState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Popup

PropertyRequiredTypeMeaning
childrenNoReactNodeSee the usage contract and declaration.
classNameNostring | ((state: MenuPopupState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
finalFocusNoboolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefinedDetermines the element to focus when the menu is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, or false/undefined to do nothing.
idNostring | undefinedSee the usage contract and declaration.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuPopupState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuPopupState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Item

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuItemState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
closeOnClickNoboolean | undefinedWhether to close the menu when the item is clicked.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
idNostring | undefinedSee the usage contract and declaration.
labelNostring | undefinedOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to true if the rendered element is a native button.
onClickNo((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void) | undefinedThe click handler for the menu item.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuItemState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuItemState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.LinkItem

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuLinkItemState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
closeOnClickNoboolean | undefinedWhether to close the menu when the item is clicked.
idNostring | undefinedSee the usage contract and declaration.
labelNostring | undefinedOverrides the text label to use when the item is matched during keyboard text navigation.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, MenuLinkItemState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuLinkItemState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.CheckboxItemIndicator

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuCheckboxItemIndicatorState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
keepMountedNoboolean | undefinedWhether to keep the HTML element in the DOM when the checkbox item is not checked.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuCheckboxItemIndicatorState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuCheckboxItemIndicatorState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.RadioItemIndicator

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuRadioItemIndicatorState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
keepMountedNoboolean | undefinedWhether to keep the HTML element in the DOM when the radio item is inactive.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuRadioItemIndicatorState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuRadioItemIndicatorState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Backdrop

Example disposition: Optional popup presentation parts. The live menu demonstrates keyboard actions, checked/radio state and submenu composition with an unadorned popup.

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuBackdropState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuBackdropState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuBackdropState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Arrow

Example disposition: Optional popup presentation parts. The live menu demonstrates keyboard actions, checked/radio state and submenu composition with an unadorned popup.

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuArrowState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuArrowState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuArrowState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Viewport

Example disposition: Optional popup presentation parts. The live menu demonstrates keyboard actions, checked/radio state and submenu composition with an unadorned popup.

PropertyRequiredTypeMeaning
childrenNoReactNodeThe content to render inside the transition container.
classNameNostring | ((state: MenuViewportState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuViewportState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuViewportState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.CheckboxItem

PropertyRequiredTypeMeaning
checkedNoboolean | undefinedWhether the checkbox item is currently ticked. To render an uncontrolled checkbox item, use the defaultChecked prop instead.
classNameNostring | ((state: MenuCheckboxItemState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
closeOnClickNoboolean | undefinedWhether to close the menu when the item is clicked.
defaultCheckedNoboolean | undefinedWhether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
idNostring | undefinedSee the usage contract and declaration.
labelNostring | undefinedOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to true if the rendered element is a native button.
onCheckedChangeNo((checked: boolean, eventDetails: Base.CheckboxItem.ChangeEventDetails) => void) | undefinedEvent handler called when the checkbox item is ticked or unticked.
onClickNo((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void) | undefinedThe click handler for the menu item.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuCheckboxItemState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuCheckboxItemState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.RadioItem

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuRadioItemState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
closeOnClickNoboolean | undefinedWhether to close the menu when the item is clicked.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
idNostring | undefinedSee the usage contract and declaration.
labelNostring | undefinedOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to true if the rendered element is a native button.
onClickNo((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void) | undefinedThe click handler for the menu item.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuRadioItemState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuRadioItemState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
valueYesanyValue of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Group

PropertyRequiredTypeMeaning
childrenNoReactNodeThe content of the component.
classNameNostring | ((state: MenuGroupState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuGroupState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuGroupState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.GroupLabel

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuGroupLabelState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuGroupLabelState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuGroupLabelState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Separator

PropertyRequiredTypeMeaning
classNameNostring | ((state: SeparatorState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
orientationNoOrientation | undefinedThe orientation of the separator.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SeparatorState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: SeparatorState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.SubmenuTrigger

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuSubmenuTriggerState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
closeDelayNonumber | undefinedHow long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the openOnHover prop.
delayNonumber | undefinedHow long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the openOnHover prop.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
idNostring | undefinedSee the usage contract and declaration.
labelNostring | undefinedOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to true if the rendered element is a native button.
onClickNo((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void) | undefinedSee the usage contract and declaration.
openOnHoverNoboolean | undefinedWhether the menu should also open when the trigger is hovered.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuSubmenuTriggerState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuSubmenuTriggerState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

ContextMenu.Portal

PropertyRequiredTypeMeaning
classNameNostring | ((state: MenuPortalState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
containerNoHTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null | undefinedA parent element to render the portal element into.
keepMountedNoboolean | undefinedWhether to keep the portal mounted in the DOM while the popup is hidden.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuPortalState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: MenuPortalState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.

ContextMenu.Root

PropertyRequiredTypeMeaning
actionsRefNoReact.RefObject<MenuRootActions | null> | undefinedA ref to imperative actions. - unmount: Manually unmounts the menu. Call this after any externally controlled closing animation finishes. - close: When specified, the menu can be closed imperatively.
childrenNoReact.ReactNodeSee the usage contract and declaration.
closeParentOnEscNoboolean | undefinedSee the usage contract and declaration.
defaultOpenNoboolean | undefinedWhether the menu is initially open. To render a controlled menu, use the open prop instead.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
highlightItemOnHoverNoboolean | undefinedWhether moving the pointer over items should highlight them. Disabling this prop allows CSS :hover to be differentiated from the :focus (data-highlighted) state.
loopFocusNoboolean | undefinedWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
onOpenChangeNo((open: boolean, eventDetails: ContextMenuRoot.ChangeEventDetails) => void) | undefinedEvent handler called when the menu is opened or closed.
onOpenChangeCompleteNo((open: boolean) => void) | undefinedEvent handler called after any animations complete when the menu is opened or closed.
openNoboolean | undefinedWhether the menu is currently open.
orientationNoMenuRootOrientation | undefinedThe visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys.

ContextMenu.Trigger

PropertyRequiredTypeMeaning
classNameNostring | ((state: ContextMenuTriggerState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ContextMenuTriggerState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: ContextMenuTriggerState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"context-menu", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"context-menu", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Defaults and customization

Descriptor defaults: {"size":"md","tone":"neutral"}. Parts: trigger. Explicit instance props take precedence over configured defaults.

Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.

State, events and accessibility

For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.

Declaration authority

Generated from packages/faye-ui/dist/overlays/context-menu.d.ts after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. React DOM attributes and Base UI component contracts describe the inherited foundations.