Popover

The Popover is a non-modal dialog that floats around its disclosure. It's commonly used for displaying additional rich content on top of something.

import Popover from "@ds-kit/popover"

Basic Example

A basic example of an Popover component can look like this:

<Popover disclosure={<Button variant="primary">Open popover</Button>}>
  Custom popover
</Popover>

Popover with custom children

<Popover disclosure={<Button variant="primary">Open popover</Button>}>
  <Div width="6rem" height="6rem" bg="primary" borderRadius="100%" />
</Popover>

Popover using popoverStateProps to set placement

<Popover
  placement="auto-end"
  disclosure={<Button variant="primary">Open popover</Button>}
>
  Custom very-very-very long popover text
</Popover>

Popover props

Name
Type
Default
borderStyle
string
"solid"
borderWidth
string
"1px"
borderRadius
string
"0.25rem"
borderColor
string
"rgba(33, 33, 33, 0.25)"
bg
string
"white"
disclosure *
elementobject
placement
string
"top-center"
visible
bool
false
boundariesElement
string
"scrollParent"
tabIndex
number
0
ariaLabel
string
"aria-label"
boxShadow
string
"sm"
children
node