Popover

Component for rendering floating card popped by hovering on a trigger element. Generally, used for:

  • A simple popup menu to provide extra information or operations.
  • Comparing with Tooltip, besides information Popover card can also provide action elements like links and buttons.

Usage

The Popover component can be imported using

import { Popover } from '@tail-kit/tail-kit'
Editable Example

Default Popover

Brad Gibson
@bradgibson

Popover Trigger with Click Event

Brad Gibson
@bradgibson

Controlled Popover

Popover Props

NameDescriptionDefault Value
title
Title shown in the popover
ReactNode
--
content
Content of the popover
ReactNode
--
placement
The default placement of the tooltip. If the default placement cannot be used because of constraints, the tooltip placement would be computed automatically. It can be one of `topLeft`, `top`, `topRight`, `left`, `right`, `bottomLeft`, `bottom` and `bottomRight`
string | undefined
top
closeDelay
The delay in closing the tooltip on mouse leave. A delay is added so that the user can move over the tooltip content before being closed. If the delay is set to 0, it would close as soon as the mouse leaves, but the user cannot select the content present inside tooltip.
number | undefined
100
visible
Whether the popover is visible or not. If visible, it set the Popover component would be a controlled component, and the visibility state can be updated using `onVisiblityChange` prop.
boolean | undefined
--
onVisibilityChange
Handler function called when the visibility state is updated
OnVisibilityChange | undefined
--
triggerEvent
Event triggering the visiblity of popover. Whether is should be visible on hover or click
"click" | "hover" | undefined
hover
hideArrow
Hide Arrow pointer of Popover
boolean | undefined
--
portalParent
parent of the portal container
HTMLElement | undefined
--
children
Content for which the tooltip is to be shown
ReactElement<any, string | JSXElementConstructor<any>>
--