Docs
Popover

Popover

The floating card pops up when clicking/mouse hovering over an element.

Usage

Example Code

1import {
2Popover,
3PopoverContent,
4PopoverTrigger,
5} from "inc-design-system/popover";

Example Code

1<Popover>
2<PopoverTrigger>Open Popover Trigger</PopoverTrigger>
3<PopoverContent>Popover Content</PopoverContent>
4</Popover>

Props

Popover

For more props:

PropTypeDescriptionDefault
defaultOpenbooleanDetermines whether the popover is open by default.No default value
openbooleanDetermines whether the popover is currently open.No default value
onOpenChangefunctionA function called when the visibility of the popover changes.No default value
modalbooleanDetermines whether the popover is displayed as a modal.false

PopoverTrigger

For more props:

PropTypeDescriptionDefault
asChildbooleanDetermines whether the trigger element is a child of the Popover component.false

PopoverContent

For more props:

PropTypeDescriptionDefault
asChildbooleanDetermines whether the content element is a child of the Popover component.false
onOpenAutoFocusfunctionA function called when the content is opened and should receive focus.No default value
onCloseAutoFocusfunctionA function called when the content is closed and should receive focus.No default value
onEscapeKeyDownfunctionA function called when the 'Escape' key is pressed while the content is focused.No default value
onPointerDownOutsidefunctionA function called when a pointer down event occurs outside of the content.No default value
onFocusOutsidefunctionA function called when the content loses focus.No default value
onInteractOutsidefunctionA function called when an interaction occurs outside of the content.No default value
forceMountbooleanDetermines whether the content is force-mounted, ignoring visibility.No default value
side'left' | 'right' | 'bottom' | 'top'Determines the side from which the content appears.'bottom'
sideOffsetnumberDetermines the offset from the side from which the content appears.0
align'start' | 'end' | 'center'Determines the alignment of the content.'center'
alignOffsetnumberDetermines the offset from the alignment of the content.0
avoidCollisionsbooleanDetermines whether the content avoids collisions with other elements.true
collisionBoundaryBoundary[]Specifies the boundary within which collisions are detected.[]
collisionPaddingnumber | PaddingDetermines the padding used for collision detection.0
arrowPaddingnumberDetermines the padding used for the arrow.0
sticky'none' | 'partial' | 'fixed'Determines the sticky behavior of the content.'partial'
hideWhenDetachedbooleanDetermines whether the content is hidden when detached.false