Skip to main content

Popover

Similar to Tooltip, but can host a title and richer content (HTML structures, lists, etc.), triggered by click or hover.

Basic usage​

Placements, triggers, and the arrow
import { LhButton, LhPopover } from '@lh-ui/react'

export default function Demo() {
return (
<LhPopover title="Title" content="This is the popover content." placement="top">
<LhButton>Top</LhButton>
</LhPopover>
)
}

Popover Props​

PropDescriptionTypeOptionsDefault
childrenTrigger nodeReactNode——
titleTitle (rendered in the __title area)ReactNode——
contentContent (rendered in the __content area)ReactNode——
placementPlacementLhPopoverPlacementtop / bottom / left / right (with -start / -end)'top'
triggerTrigger methodLhPopoverTrigger'hover' | 'click' | 'focus' | 'manual''click'
disabledDisable the popoverboolean—false
arrowWhether to show the arrowboolean—true
widthOverlay widthstring | number——
visibleControlled visibilityboolean——
defaultVisibleUncontrolled default visibilityboolean—false
showAfterShow delay (ms; 200 by default to avoid accidental triggers)number—200
hideAfterHide delay (ms; 100 by default to let the pointer move into the overlay)number—100
popperClassCustom overlay class namestring——
themeVarsComponent-level theme variablesRecord<string, string>——
bgPatternComponent-level background patternstring——
sxShorthand layout props (applied to the trigger)SxProps——

Popover events​

EventDescriptionCallback signatureVue equivalent
onVisibleChangeVisibility change (fires in both controlled and uncontrolled modes)(visible: boolean) => voidupdate:visible

ref​

forwardRef<HTMLDivElement> — the trigger root element. LhPopoverInstance exposes show() / hide() / toggle() / isVisible.

Focus trap

With trigger="click", the overlay traps focus by dialog semantics (Tab cycles inside) and returns focus on close; hover / focus triggers do not steal focus, consistent with plus's isModal behavior.

Accessibility

The overlay is role="dialog"; when a title exists it is associated via aria-labelledby, and the trigger is associated with the overlay via aria-describedby.

Styles​

import '@lh-ui/react/style/popover'