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' | |
alignmentOffset | number | 4 | An additional offset, in pixels, to move the floating element from the aligning edge. Positive values move the floating element in the direction of center-alignment. Negative values move the floating element away from center-alignment. When align is |
anchorOffset | number | 4 | The number of pixels between the anchor edge and the floating element. Positive values move the floating element farther from the anchor element (for outside positioning) or further inside the anchor element (for inside positioning). Negative values have the opposite effect. If |
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 |