Popovers are initiated with a click and enable users to reveal contextual information about a feature or element.

Example

⌘ Cmd + ⌥ Option + 1

Properties

"Button" Component
propertypropTyperequireddefaultdescription
isSubmitbool-falseMake the button act as a submit button
isDisabledbool-falsePrevent users from interacting with the button
widthoneOf 'default' | 'full'-'default'Various height and width options
isLinkbool-falseChanges the button to a div for insertion within a Link component
onBlurfunc-() => {}Function that fires when the button loses focus
onClickfunc-() => {}Function that fires when the button is clicked on
onMouseDownfunc-() => {}Function that fires when the button is mouse downed
ariaLabelstring--Describes buttons that have an icon but no text
childrennodeyes-Text within the button
isActivebool--Render button with active state
sizeoneOf 'tiny' | 'small' | 'large' | 'narrow' | 'tight'--Various height and width options
styleoneOf 'highlight' | 'danger' | 'danger-outline' | 'outline' | 'outline-reverse' | 'plain' | 'toggle' | 'underline' | 'unstyled'--Various color options
testSectionstring--Hook for automated JavaScript tests
"OverlayWrapper" Component
propertypropTyperequireddefaultdescription
behavioroneOf 'click' | 'hover'-'click'Event to listen to and open the overlay
isConstrainedToScreenbool-falseAttach `overlay` to an edge of the screen if it is going to move off
shouldHideOnClickbool-trueShould the `overlay` close when clicking outside of it
horizontalAttachmentoneOf 'left' | 'center' | 'right'-'center'Side of the `overlay` that should attach to the `children`
verticalAttachmentoneOf 'top' | 'middle' | 'bottom'-'top'Vertical edge of the `overlay` that should touch the `children`
childrennodeyes-Element that the `overlay` should attach to
horizontalTargetAttachmentoneOf 'left' | 'center' | 'right'--Side of `children` that should attach to the `overlay`
onHidefunc-- Function that runs when the `overlay` is hidden. Return `false` to prevent
the `overlay` from closing.
onShowfunc--Function that runs when the `overlay` is shown
overlaynodeyes-The element that is attached to the children
testSectionstring--Hook for automated JavaScript tests
verticalTargetAttachmentoneOf 'top' | 'middle' | 'bottom'--Vertical edge of the `children` that should touch the `overlay`

Usage

Popovers allow the user to hover to see additional information, like a definition, formula, or link to additional explanation. They are presented when the user hovers over a target after small delay. The target may be a button, icon, or other element. The size of the popover is dictated by content.

Best Practices

Do's

Keep your content short (< 300 char). Use a link if additional explanation is needed.

Each popover should be a single thought or idea. Use multiple popovers for multiple ideas, but don't go crazy.

Dont's

Don't use buttons or inputs inside popovers.

Avoid overly large popovers that have an excessive amount of content.