Skip to main content

Popover

A popover is used to show more information when a user interacts with a trigger element.

Demo

Usage

When to use

  • Show more information. Use a popover to show information that isn't essential to the current workflow, but that might be useful to know.
  • Offer interaction. A popover can show interactive elements, like buttons, unlike a Tooltip which only shows text.

When not to use

  • Essential information. Don't use popovers for essential information or actions, because a user might not know they are there.

Format

  • A popover doesn't offer any default content styling.
  • Include padding between the popover frame and the content inside. The amount of padding depends on the content and density of the interface. Use a spacer constant for a consistent visual experience.

API Reference

Popover

Usage

To use Popover, you can import the component from the @dhis2/ui library

import { Popover } from '@dhis2/ui'

Props

NameTypeDefaultRequiredDescription
childrennode*
arrowbooleantrueShow or hide the arrow
classNamestring
dataTeststring'dhis2-uicore-popover'
elevationstringelevations.e200Box-shadow to create appearance of elevation. Use elevations constants from the UI library.
maxWidthnumber360
observePopperResizeboolean
observeReferenceResizeboolean
placementcustom'top'
referencecustomA React ref that refers to the element the Popover should position against
onClickOutsidefunction