useMenu hook provides the logic to build custom menu (single-select facet) components.
Import
Parameters
The attribute to create the menu for.
Maximum number of items to display.
Whether to enable the “show more” functionality.
Maximum number of items to display when “show more” is active.
How to sort the menu items.
Function to transform the items.
Returns
The list of menu items.
Function to select a menu item. Selecting an already selected item deselects it.
Whether refinements can be applied.
Whether “show more” is currently active.
Function to toggle between showing more/less items.
Whether the “show more” toggle is available.
Function to create a URL for a menu item.
Function to send Insights events.