Skip to main content

Popover

A floating panel anchored to a trigger element, built on Radix UI's Popover primitive. Click each button below to open it.

import { Button, Popover } from '@jbpark/ui-kit';

<Popover title="Title" content={<p>Content</p>}>
<Button>Open</Button>
</Popover>;

Props

PropTypeDefault
titleReactNode-
contentReactNode-
placementplacement name (see below)'top'
openboolean-
defaultOpenboolean-
onOpenChange(open: boolean) => void-
childrenReactNode (the trigger)-

placement: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom'.

Works both controlled (pass open + onOpenChange) and uncontrolled (pass defaultOpen, or neither). Popover also accepts the rest of React.ComponentPropsWithoutRef<'div'> (applied to the content panel).