<Popover
defaultOpen={false}
disableAutoUpdate={false}
disableCaret={false}
disableCloseOnEscape={false}
disableCloseOnClickOutside={false}
modal={true}
noPadding={false}
open={false}
openOnHover={false}
placement="bottom"
onClose={() => {}}
onClickOutside={() => {}}
onOpenAnimationStart={() => {}}
onOpenAnimationComplete={() => {}}
onCloseAnimationStart={() => {}}
onCloseAnimationComplete={() => {}}
>
<Popover.Button>Trigger</Popover.Button>
<Popover.Content>Content</Popover.Content>
</Popover>
Popover Props
Should include Popover.Button or Popover.Trigger and Popover.Content.
Controls the default open state on uncontrolled popovers.
Disables all focus management entirely. Useful to delay focus management until
after a transition completes or some other conditional state.
Removes the caret between the trigger and content.
disableCloseOnClickOutside
Traps focus within the popover content.
Removes padding from popover content.
Callback when clicking outside the popover.
Called when the popover is closed, except after mouse exits when openOnHover
is true.
Callback when closing animation completes.
Callback when closing animation starts.
Callback when opening animation completes.
Callback when opening animation starts.
Use to control open state of the popover.
Opens the popover on hover over the trigger. In most cases, use a
Tooltip instead. placement
"bottom" | "bottom-end" | "bottom-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start"
default:"bottom"
<Popover.Trigger>
{(data) => (
<button {...data} aria-expanded={data["aria-expanded"]} onClick={data.onClick}>
Custom Trigger
</button>
)}
</Popover.Trigger>
Popover.Trigger Props
The data parameter includes "aria-expanded", a ref for the trigger
component, and some additional accessibility fields.