React Popover Component API
Popover API
Explore the API reference for the React Popover component and discover how to effectively utilize its props for customization.
CPopover#
import { CPopover } from '@coreui/react'// orimport CPopover from '@coreui/react/src/components/popover/CPopover'
Property | Default | Type |
---|---|---|
animation#4.9.0+ | true | boolean |
Adds a fade transition animation to the React Popover. | ||
className# | - | string |
Custom class name(s) for additional styling. | ||
container#4.11.0+ | document.body | Element , DocumentFragment , (() => Element | DocumentFragment) |
Defines the container element to which the React Popover is appended.
| ||
content# | - | ReactNode |
Main content of the React Popover. It can be a string or any valid React node. | ||
delay#4.9.0+ | 0 | number , { show: number; hide: number; } |
Delay (in milliseconds) before showing or hiding the React Popover.
| ||
fallbackPlacements#4.9.0+ | ['top', 'right', 'bottom', 'left'] | 'top', 'right', 'bottom', 'left' , ('top', 'right', 'bottom', 'left')[] |
Specifies the fallback placements when the preferred | ||
offset# | [0, 8] | [number, number] |
Offset of the React Popover relative to its toggle element, in the form
| ||
onHide# | - | () => void |
Invoked when the React Popover is about to hide. | ||
onShow# | - | () => void |
Invoked when the React Popover is about to show. | ||
placement# | top | 'auto' , 'top' , 'bottom' , 'right' , 'left' |
Placement of the React Popover. Popper.js may override this based on available space. | ||
popperConfig#5.5.0+ | - | Partial<Options> , ((defaultPopperConfig: Partial<Options>) => Partial<Options>) |
Allows customization of the Popper.js configuration for the React Popover.
| ||
title# | - | ReactNode |
Title for the React Popover header. Can be a string or any valid React node. | ||
trigger# | click | 'hover' , 'focus' , 'click' , ('hover' | 'focus' | 'click')[] |
Determines which events trigger the visibility of the React Popover. Can be a single trigger or an array of triggers.
| ||
visible# | - | boolean |
Controls the visibility of the React Popover.
|