overlayspopup
Popup
Low-level overlay primitive providing portal, backdrop, and content positioning.
Import#
Slot Structure#
Wrapper trigger with an optional backdrop and a floating content portal.
Examples#
Default Container#
Popup provides only container + overlay. Content styling is fully custom.
Dismiss Control#
Block outside dismiss and count prevent-close attempts.
Scrollable Overlay Mode#
Scrollable overlay keeps content in flow while preserving the backdrop.
API Reference#
Attributes#
Slot
trigger0 attributesElement users activate to open the popup.
No attribute metadata for this slot.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| children | JSX.Element | — | Element that triggers the popup or additional content. |
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | PopupT.Classes | undefined | — | — |
| content | ComponentOrElement<ModalContentContext> | undefined | — | Modal content rendered inside the content surface. |
| defaultOpen | boolean | undefined | — | Initial open state when uncontrolled. |
| dismissible | boolean | undefined | — | Whether outside interaction and Escape should dismiss the shell. |
| fullscreen | boolean | undefined | false | Whether the popup should cover the entire viewport. |
| id | string | undefined | — | Unique identifier used to derive the content id. |
| layout | "default" | "scrollable" | "fullscreen" | undefined | — | — |
| onClosePrevent | (() => void) | undefined | — | Called when a dismissal attempt is blocked. |
| onOpenChange | ((open: boolean) => void) | undefined | — | Called whenever the open state changes. |
| open | boolean | undefined | — | Controlled open state. |
| overlay | boolean | undefined | — | Whether to render the overlay element. |
| ref | JSX.HTMLElementTags["span"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| scrollable | boolean | undefined | false | Whether to allow scrolling within the popup. |
| style | JSX.CSSProperties | undefined | — | — |
| styles | PopupT.Styles | undefined | — | — |