Primer React hooks
Usage and code-level documentation for Primer React's hooks.
Used to calculate the position of a "floating" element that is anchored to another element.
Used prevent focus from leaving a particular element.
Used to designate a container where focus can be moved using keys other than
A simple utility Hook that calls a user-provided function when the
Escape key is pressed.
A utility Hook that calls a user-provided callback function when the user clicks outside of the provided container.
A utility Hook that focuses an element when a component is first mounted and returns focus to another element when the component unmounts.
Provides all relevant
Overlay behavior and provides a ref for the overlay's container.
A utility Hook that allows safely calling
clearTimeout within a component.