PopUp
Overview
PopUp is the popup shell: a reka-ui Dialog wrapper with a media slot and a default content slot. It's the foundation behind the curated presets PopUpInfo, PopUpNewsletter, and PopUpPromotion, which render their fields into that default slot. Reach for the shell directly when none of the presets fit; otherwise use a preset.
Reka-ui Dialog semantics handle focus management and keyboard interaction.
Layout and dismiss controls
The shell exposes the dismiss and layout knobs presets inherit:
closeOnEsc(defaulttrue) decides whether the Escape key closes the popup.closeOnOverlayClick(defaulttrue) decides whether clicking the backdrop closes the popup.mediarenders on the leading side (top on mobile, left or right on desktop). Themediaslot lets you replace the default<Media>rendering with custom markup.backgroundMediaoverlays a full-popup background image behind both the media slot and the content stack.imagePositionDesktop('left'or'right') flips desktop layout direction when media is present.alignment('left'or'center') sets the horizontal alignment of the content stack.containerStyle('boxed'or'full') controls the mobile container; on desktop the popup is always boxed and centered.closeButtonVariantMobileandcloseButtonVariantDesktopaccept anyButtonvariant; the shell renders both close buttons and CSS picks one per viewport.closeevent fires when the user dismisses the popup (alongsideupdate:open).
Key Business & UX Benefits
- One popup shell powers every dialog on the site, so brand chrome and motion stay identical from newsletter prompt to terms notice.
- Reka-UI Dialog semantics deliver focus traps, escape handling, and ARIA roles out of the box, removing the accessibility risk that popups usually carry.
- The media slot plus content stack gives designers a clean canvas for custom popups when no preset fits.
- Builds the foundation for
PopUpInfo,PopUpNewsletter, andPopUpPromotion, keeping one accessibility audit valid across every variant.
Usage
<PopUp v-model:open="showModal">
<template #media>
<MediaPreview :media="popupImage" />
</template>
<TextGroup heading="..." subline="..." />
<Button>CTA</Button>
<!-- Or drop in a preset: <PopUpInfo ... /> -->
</PopUp>
Feature List
- Reka-UI Dialog wrapper handles focus traps, escape key, and ARIA roles with no extra accessibility work
- Media slot renders on the leading side (top mobile, left or right desktop) with imagePositionDesktop flipping direction
- backgroundMedia overlays a full-popup image behind both the media slot and content stack for dramatic placements
- Layout knobs: closeOnEsc, closeOnOverlayClick, alignment ('left' or 'center'), and containerStyle ('boxed' or 'full')
- Separate closeButtonVariantMobile and closeButtonVariantDesktop let CSS pick the right close style per viewport
- close event plus update:open hand dismiss handling back to the parent for analytics or persistence
- Foundation behind PopUpInfo, PopUpNewsletter, and PopUpPromotion, so one accessibility audit covers every variant
API Reference
| Prop | Default | Type |
|---|---|---|
open | false | booleanControls open state (use with v-model:open). |
containerStyle | boxed | PopUpContainerStyle ("boxed" | "full")Mobile-only container style — on desktop the pop-up is always boxed/centered. |
alignment | left | PopUpAlignment ("left" | "center")Horizontal alignment of the content stack. |
imagePositionDesktop | left | PopUpImagePositionDesktop ("left" | "right")Desktop layout direction when media is present. |
closeButtonVariantMobile | glass-black | ButtonVariant ("primary" | "secondary" | 12 more)Close button variant for mobile viewports. |
closeButtonVariantDesktop | glass-black | ButtonVariant ("primary" | "secondary" | 12 more)Close button variant for desktop viewports. |
media | MediaImage { type, sources, placeholder, 2 more }Optional media rendered on the leading side (top on mobile, left/right on desktop). | |
backgroundMedia | MediaImage { type, sources, placeholder, 2 more }Optional full-pop-up background media (overlays media slot). | |
closeOnEsc | true | booleanClose on Escape key. |
closeOnOverlayClick | true | booleanClose when clicking the overlay. |
| Slot | Type |
|---|---|
media | {} |
default | {} |
| Event | Type |
|---|---|
update:open | (event: "update:open", value: boolean): void |
close | (event: "close"): void |