xl vision
  • Component
  • React Hooks
  • Playground
  • Overview
  • Color
  • Getting Start
    • Installation
  • General
    • Icon
    • Button
  • Layout
    • Grid
  • Form
    • Input
    • InputNumber
    • Textarea
  • Navigation
    • Dropdown
    • Affix
    • BackTop
    • Anchor
  • Data Display
    • Tooltip
    • Popover
    • Avatar
  • Faceback
    • Popconfirm
    • Dialog
    • Message
    • Notication
  • Animation
    • Transition
    • TransitionGroup
    • CollapseTransition
    • Ripple
  • Styles
    • Theme
    • CssBaseline
  • Basic Component
    • BaseButton
    • Portal
    • Popper
    • Modal
    • ResizeObserver

Popper

Basic pop-up box implementation.

This component is very powerful. The reference component wrapped by this component will not produce any wrapped elements on the dom, so it will not have any impact on the reference component. The content of the pop-up box of this component will only be mounted when it is actually triggered, so performance is guaranteed.

Examples

Basic

Basic

Different trigger methods

Different trigger methods

Arrow

Arrow

Nest

Nest

Properties

To use this component, the child component needs to expose the ref instance and the events of onClick, onMouseEnter, onMouseLeave, onFocus, onBlur, and onContextMenu.

PropertyDescriptionTypeDefaultRequire
childrenChild nodeReact.ReactElement—true
popupPop-up boxReact.ReactElement-true
placementSpecify the orientation of the pop-up boxauto | auto-start | auto-end | top | top-start | top-end | right | right-start | right-end | bottom | bottom-start | bottom-end | left | left-start | left-endautofalse
popupContainerSpecify the parent container of the pop-up boxstring | HTMLElement | (() => string | HTMLElement)() => bodyfalse
openWhether to show pop-up boxboolean-false
defaultOpenWhether the default pop-up box is displayed, when open exists, the option is invalidbooleanfalsefalse
onOpenChangeCallback when the status of the popup box changes(open: boolean) => void-false
triggerTrigger methodhover | focus | click | contextMenu | false | arrayhoverfalse
transitionClassNameAnimation class name, see CssTransitionstring-false
classNamePop-up box class namestring0false
onAfterClosedCallback when popup is closed() => void-false
mountOnShowDom will mount when popper showsbooleantruefalse
unmountOnHideDom will unmount when popper hidesboolean-false
hoverOptionsoptions for hover action, see usePopperHoverOptions-false
clickOptionsoptions for click action, see usePopperClickOptions-false
focusOptionsoptions for focus action, see usePopperFocusOptions-false
contextMenuOptionsoptions for contextMenu action, see usePopperContextMenuOptions-false
shiftOptionscontrols the popper's offset behavior when it encounters occlusion, see usePopperShiftOptions | false-false
autoPlacementOptionscontrols the behavior of the popper to switch positioning when it encounters occlusion, see usePopperAutoPlacementOptions | false-false
arrowOptionscontrol arrow behavior, see usePopperArrowOptions-false
autoUpdateOptionscontrol how automatic positioning, see usePopperAutoUpdateOptions-false
arrowArrowReact.ReactNode-false
offsetPop-up box offset, see usePopperOffsetOptions0false
Examples
Basic
Different trigger methods
Arrow
Nest
Properties
Copyright © 2020-2021 Rhys Xia