Popup
Popup foundation combining overlay, placement, close behavior, safe area, and destroy policy.
Runtime ownership
usePopupRoot comes from @varo-ui/headless; H5 and Weapp implement placement and safe area separately.
Demo
Install
bash
pnpm add @varo-ui/headless @varo-ui/h5
# or
pnpm add @varo-ui/headless @varo-ui/weappWhy this is foundational
- Bottom sheets, drawers, and action panels share one visible contract.
- Decoupled position and overlay support more UI wrappers.
Parts
| Part | Role |
|---|---|
PopupRoot | Visibility, overlay, content, close, and placement |
State and events
- State:
visible,position,overlay,closeable,round, anddestroyOnClose - Events:
update:visible,visibleChange,close, andclickOverlay.
Platform notes
Weapp safe area and H5 viewport adapt separately while public state stays aligned.