An AnchoredOverlay
provides an anchor that will open a floating overlay positioned relative to the anchor.
The overlay can be opened and navigated using keyboard or mouse.
See also Overlay positioning.
Name | Type | Default | Description |
---|---|---|---|
open | boolean | false | Determines whether the overlay portion of the component should be shown or not. |
onOpen | (gesture: 'anchor-click' | 'anchor-key-press') => unknown | A callback that is called whenever the overlay is currently closed and an "open gesture" is detected. | |
onClose | (gesture: 'anchor-click' | 'click-outside' | 'escape') => unknown | A callback that is called whenever the overlay is currently open and a "close gesture" is detected. | |
renderAnchor | <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element | A custom function component used to render the anchor element. When renderAnchor is null, an anchorRef is required. | |
anchorRef | React.RefObject<HTMLElement> | An override to the internal | |
anchorId | string | An override to the internal id that will be passed to the anchor. | |
side | | 'inside-top' | 'inside-bottom' | 'inside-left' | 'inside-right' | 'inside-center' | 'outside-top' | 'outside-bottom' | 'outside-left' | 'outside-right' | 'outside-bottom' | |
align | 'start' | 'center' | 'end' | 'start' | |
overlayProps | Partial<OverlayProps> | Props to be spread on the internal | |
focusTrapSettings | Partial<FocusTrapHookSettings> | Settings to apply to the focus trap on the internal | |
focusZoneSettings | Partial<FocusZoneHookSettings> | Settings to apply to the focus zone on the internal |