Socket
Socket
Sign inDemoInstall

@aria-ui/menu

Package Overview
Dependencies
35
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @aria-ui/menu

## Functions


Version published
Weekly downloads
6
decreased by-25%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@aria-ui/menu

Functions

useMenuTrigger()

function useMenuTrigger(element: ConnectableElement): Object;

MenuContent

MenuContentElement

A custom MenuContent element.

new MenuContentElement(): MenuContentElement
PropertyTypeDescription
altBoundarybooleanSee
https://floating-ui.com/docs/detectoverflow

Default
true
autoUpdateboolean | Partial<Object>Options to activate auto-update listeners

See
https://floating-ui.com/docs/autoUpdate

Default
true
boundaryBoundarySee
https://floating-ui.com/docs/detectoverflow

Default
'clippingAncestors'
elementContextElementContextSee
https://floating-ui.com/docs/detectoverflow

Default
'floating'
fitViewportbooleanWhether to constrain the floating element's width and height to not exceed
the viewport.

Default
false
flipboolean | Placement[]Whether to flip the placement in order to keep it in view when the
preferred placement(s) will overflow the clipping boundary. You can also
provide an array of placements to try sequentially if the preferred
placement does not fit.

Default
true
hidebooleanWhether to hide the floating element when the reference element or the
floating element is fully clipped.

Default
false
hoistbooleanWhether to use the browser Popover API
to place the floating element on top of other page content. When enabled,
the floating element won't be clipped by an ancestor. This provides a
similar result to React's <Portals> or Vue's <Teleport>.

Default
true
inlinebooleanWhether to improve positioning for inline reference elements that span over
multiple lines.

Default
false
offsetnull | OffsetOptionsThe distance between the reference and floating element.

Default
4
onEscapeKeyDownnull | (event: KeyboardEvent) => voidEvent handler called when the escape key is pressed.

By default, the popover will be closed. It can be prevented by calling
event.preventDefault.
onFocusOutsidenull | (event: FocusOutsideEvent) => voidEvent handler called when the focus is moved outside the element.

By default, the popover will be closed. It can be prevented by calling
event.preventDefault.
onInteractOutsidenull | (event: InteractOutsideEvent) => voidFunction called when an interaction (pointer or focus) happens outside the
component.

By default, the popover will be closed. It can be prevented by calling
event.preventDefault.
onKeydownHandlerAddnull | (handler: (event: KeyboardEvent) => void) => VoidFunctionBy default, the menu element will listen for keydown events. However,
you can pass onKeydownHandlerAdd to override the default behavior.
onKeydownHandlerAdd receives a keydown handler when the Menu element
is mounted, and returns a function that will be called when the Menu
element is unmounted.

Default
null
onPointerDownOutsidenull | (event: PointerDownOutsideEvent) => voidEvent handler called when the pointer is pressed down outside the element.

By default, the popover will be closed. It can be prevented by calling
event.preventDefault.
overflowPaddingnumberDefault
4
overlapbooleanWhether the floating element can overlap the reference element to keep it
in view.

Default
false
placementPlacementThe initial placement of the floating element

Default
"top"
rootBoundaryRootBoundarySee
https://floating-ui.com/docs/detectoverflow

Default
'viewport'
sameHeightbooleanWhether to constrain the floating element's height so that it matches the
reference element.

Default
false
sameWidthbooleanWhether to constrain the floating element's width so that it matches the
reference element.

Default
false
shiftbooleanWhether the floating element should shift to keep it in view.

Default
true
strategy"absolute" | "fixed"The strategy to use for positioning

Default
"absolute"
transformbooleanWhether to use transform: translate3d() for positioning instead of top
and left (layout) to place the floating element.

Default
false

MenuItem

MenuItemElement

A custom MenuItem element.

new MenuItemElement(): MenuItemElement
PropertyTypeDescription
filterItemFilterThe filter function to determine if an item should be shown in the listbox.

Default
defaultItemFilter
onSelectnull | VoidFunctionCallback function that is called when the item is selected.

Default
null
querystringThe query string to filter the listbox items.

Default
""
valuestringThe value of the item. Every item must have a unique value in the parent
list. By default, a random value is generated.

Default
""

MenuRoot

MenuRootElement

A custom MenuRoot element.

new MenuRootElement(): MenuRootElement
PropertyTypeDescription
defaultOpenbooleanWhether the popover is open by default.

Default
false
onOpenChangenull | (open: boolean) => voidEvent handler called when the popover's open state changes.

Default
null
openbooleanWhether the popover is open.

Default
false

MenuRootProps

type MenuRootProps: PopoverRootProps;

MenuTrigger

MenuTriggerElement

A custom MenuTrigger element.

new MenuTriggerElement(): MenuTriggerElement

FAQs

Last updated on 02 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc