API reference: @salmonui/overlays/popover
PopoverPropsinterface
import type { PopoverProps } from '@salmonui/overlays/popover';interface PopoverProps {
readonly children?: ReactNode;
readonly open?: boolean | undefined;
readonly defaultOpen?: boolean | undefined;
readonly onOpenChange?: ((open: boolean, event: PopoverOpenChangeEvent) => void) | undefined;
readonly placement?: PopoverPlacement | undefined;
readonly offset?: PopoverOffset | undefined;
readonly arrow?: boolean | undefined;
readonly collisionBoundary?: Element | null | undefined;
readonly anchor?: RefObject<Element | null> | undefined;
readonly container?: Element | null | undefined;
readonly closeOnOutsidePress?: boolean | undefined;
readonly closeOnEscape?: boolean | undefined;
readonly closeOnFocusOutside?: boolean | undefined;
readonly initialFocus?: 'first' | 'container' | false | undefined;
readonly returnFocus?: boolean | undefined;
}
| Name | Signature | Description |
|---|---|---|
childrenoptional | readonly children?: ReactNode; |
|
openoptional | readonly open?: boolean | undefined; | |
defaultOpenoptional | readonly defaultOpen?: boolean | undefined; | Applied after hydration, so server and client markup stay identical. |
onOpenChangeoptional | readonly onOpenChange?: ((open: boolean, event: PopoverOpenChangeEvent) => void) | undefined; | |
placementoptional | readonly placement?: PopoverPlacement | undefined; | Logical placement, resolved against |
offsetoptional | readonly offset?: PopoverOffset | undefined; | Gap to the anchor in px (default 8), or |
arrowoptional | readonly arrow?: boolean | undefined; | Renders an arrow pointing at the anchor. Default false. |
collisionBoundaryoptional | readonly collisionBoundary?: Element | null | undefined; | Element whose box limits flip and shift (a scrolling container). Default the viewport. |
anchoroptional | readonly anchor?: RefObject<Element | null> | undefined; | Anchor element other than the trigger (a field the popover belongs to). |
containeroptional | readonly container?: Element | null | undefined; | Portal target for browsers without the Popover API (top layer otherwise). Default |
closeOnOutsidePressoptional | readonly closeOnOutsidePress?: boolean | undefined; | Close on a press outside the content and trigger. Default true. |
closeOnEscapeoptional | readonly closeOnEscape?: boolean | undefined; | Close on Escape. Default true. |
closeOnFocusOutsideoptional | readonly closeOnFocusOutside?: boolean | undefined; | Close when focus moves outside (Tab past the last control). Default true. |
initialFocusoptional | readonly initialFocus?: 'first' | 'container' | false | undefined; | Initial focus: the first tabbable control (default), the content element, or none. |
returnFocusoptional | readonly returnFocus?: boolean | undefined; | Return focus to the trigger on close. Default true. |