Popover
A headless Popover component for ReactLynx. It provides primitives for positioning and anchor tracking.
Basic Usage
Extra Anchor
If you want to add an extra anchor, you can use the PopoverAnchor Component.
Cross axis offset adjustment
Use 'crossAxisOffset' on PopoverPositioner to set the skidding offset of the floating element.
Structure
API
PopoverRoot
The root component of the Popover, containing all of its child components.
childreniOSAndroidHarmony
children
classNameiOSAndroidHarmony
className
debugLogiOSAndroidHarmony
Enable debug log for Popover and its sub-components.
defaultShowiOSAndroidHarmony
Determines whether the dialog should be shown by default. Use this property means the Dialog is uncontrolled.
forceMountiOSAndroidHarmony
Mount the toast and render the content even when it's not shown. At this time, the internal state is "initial".
onCloseiOSAndroidHarmony
Triggered when the popover is closed
onOpeniOSAndroidHarmony
Triggered when the popover is shown
onVisibleChangeiOSAndroidHarmony
Callback fired when the visibility of the popover changes. This is only called in controlled mode.
showiOSAndroidHarmony
Determines whether the dialog should be shown. Use this property means the Dialog is controlled. Do not use this props with 'defaultShow'.
styleiOSAndroidHarmony
style
PopoverTrigger
The element that triggers the Popover to show.
childreniOSAndroidHarmony
children
classNameiOSAndroidHarmony
className
disabled
Disable this Trigger
onClickiOSAndroidHarmony
Callback function triggered when the component is clicked
styleiOSAndroidHarmony
style
transitioniOSAndroidHarmony
If set to true, the className will has the transition classes like 'ui-entering', 'ui-leaving', 'ui-animating'
PopoverPositioner
Helps position the Content and Arrow correctly.
autoAdjustiOSAndroidHarmony
The auto-adjustment strategy for the popover. Defaults to 'size', which automatically adjusts maxHeight/maxWidth based on the popover size; 'shift' automatically adjusts the position based on the popover width/height.
classNameiOSAndroidHarmony
className
crossAxisOffsetiOSAndroidHarmony
Additional crossAxis offset. If this prop is set, the popover will be offset by the specified amount in the crossAxis direction.
placementiOSAndroidHarmony
The position of the popover
placementOffsetiOSAndroidHarmony
The offset of the popover position
popoverPositionerPropsiOSAndroidHarmony
popoverPositioner supports original view props to be directly spread in this prop.
styleiOSAndroidHarmony
style
transitioniOSAndroidHarmony
If set to true, the className will has the transition classes like 'ui-entering', 'ui-leaving', 'ui-animating'
childreniOSAndroidHarmony
children
State-based styling & rendering
This component exposes each of its internal states through two interchangeable channels, and the table below maps them one-to-one:
- CSS className — a class like
ui-<state>is toggled on the root node, so you can style it with selectors such as.ui-<state> { ... }. - Render-prop field — when
childrenis a function, the same state is passed in viachildren({ <state>: boolean, ... })for runtime-driven rendering.
ui-open
The popper is opened.
Applied when `status.open` is true.
ui-closed
The popper is closed.
If it's force mounted, the initial status will be closed.
Applied when `status.closed` is true.
ui-leaving
The popper is performing the leaving animation. Takes effect when transition:true.
Applied when `status.leaving` is true.
ui-entering
The popper is performing the entering animation. Takes effect when transition:true.
Applied when `status.entering` is true.
ui-animating
The popper is doing the animations. Takes effect when transition:true.
Applied when `status.animating` is true.
PopoverContent
The content of the Popover.
childreniOSAndroidHarmony
children
classNameiOSAndroidHarmony
className
popoverContentPropsiOSAndroidHarmony
PopoverContent supports original view props to be directly spread in this prop.
styleiOSAndroidHarmony
style
transitioniOSAndroidHarmony
If set to true, the className will has the transition classes like 'ui-entering', 'ui-leaving', 'ui-animating'
PopoverArrow
The arrow of the Popover.
childreniOSAndroidHarmony
children. Only use it when you don't want to use the default arrow. Notice when this prop is set, other props like the size and color props will be ignored and the default transform will be different.
classNameiOSAndroidHarmony
className
coloriOSAndroidHarmony
The color of the arrow. Defaults to 'black'
offsetiOSAndroidHarmony
The offset of the arrow. This prop is useful when the PopoverContent has a rounded corner and should be set to the radius of the rounded corner. Otherwise, the arrow may be placed beside the rounded corner, showing a gap between them.
sizeiOSAndroidHarmony
Arrow size. Supports
number (equal width/height) or { width, height } (unequal width/height). When using a custom child, ensure size matches the child’s visual size.styleiOSAndroidHarmony
style
transitioniOSAndroidHarmony
If set to true, the className will has the transition classes like 'ui-entering', 'ui-leaving', 'ui-animating'