Docs
SDK

Display modes

The formats a screen can open in on web and mobile, and how the call and the placement decide which one is used.

A screen opens in one of seven formats. Set the format on the placement in the dashboard, or in code: mode on web, style on mobile. On a phone the SDK maps each format to what feels native.

Which one is used

  1. The mode (web) or style (mobile) from your call, if you pass one. On web, the placement's position, size and duration are then ignored too.
  2. Otherwise the placement's format from the dashboard (web: with its position, size and duration).
  3. Otherwise modal on web, a full-screen cover on mobile.

Embedded screens (Embed a screen) ignore all of this: they draw inline. On web, a format the SDK does not know (a newer one) is drawn as a modal.

Set it in code

type DisplayFormat = 'modal' | 'fullscreen' | 'banner' | 'slide_in' | 'toast' | 'drawer' | 'launcher';
type DisplayPosition = 'top' | 'bottom' | 'bottom_right' | 'bottom_left' | 'bottom_center' | 'corner' | 'left' | 'right';
type DisplaySize = 'small' | 'medium' | 'large';
presentPaywall({ paywall: { placement: 'promo' }, mode: 'toast', position: 'bottom', duration: 5 });
presentPaywall({ paywall: { placement: 'promo' }, mode: 'drawer', position: 'right', size: 'large' });

Formats

Dashboard / modeWebMobile (style)
Popup (modal)Centred dialog on a dimmed page. Small 360, medium 440, large 560 px.Full-height sheet (a form sheet on iPad) (modal).
Full screen (fullscreen)Covers the viewport.Full-screen cover on iOS, full-screen activity on Android (fullscreen).
Slide-in (slide_in)Card near the bottom. Positions bottom_right (default), bottom_left, bottom_center. Small 320, medium 380, large 440 px.Bottom sheet as tall as the screen's content (sheet).
Banner (banner)Full-width bar pinned to top (default) or bottom.Pinned to the top or bottom edge (banner, top or bottom).
Toast (toast)Small note. Positions bottom (default), top, corner. Small 280, medium 360, large 440 px.Small card at the bottom that closes itself (toast, seconds).
Side drawer (drawer)Panel from right (default) or left over a dimmed page. Small 360, medium 440, large 560 px.Same as Popup.
Launcher (launcher)Floating button at bottom_right (default) or bottom_left that opens a screen. By hand, mode: 'launcher' opens what the launcher opens, without a button.Same as Popup, opened by the trigger (no floating button).

On mobile, position, size, maxContentWidth and closeOnBackdrop in the options override the placement's display, like style does:

  • position: top or bottom for a banner and a toast. Other formats ignore it.
  • size: small, medium or large caps the width of a modal (360, 440, 560), a sheet (320, 380, 440) and a toast (280, 360, 440) on wide screens (tablets, landscape); the content is centered. Phones are narrower, so nothing changes there. Full screen and banner ignore it. Without size in the options, the placement's size from the dashboard applies (unless you pass style, which drops it, as mode does on web); a placement with no size sets no limit.
  • maxContentWidth: a number in dp (Android) or pt (iOS) that caps the width of any format and wins over size. The page background still fills the screen.
  • closeOnBackdrop (default true): false stops a tap on the dimmed area from closing a modal or sheet on Android. On iOS it makes the sheet non-dismissible by gesture, so swiping it down no longer closes it either. Back (Android) and the screen's own close button still work.

Behaviour

Page behindScroll lock and focus trapMax height
modalDimmed (50% black)Yes100% of the viewport minus 32 px
fullscreenCoveredYes100% of the viewport
drawerDimmed (40% black)Yes100% of the viewport
bannerUsableNo40% of the viewport, scrolls inside
slide_inUsableNo100% of the viewport minus 32 px
toastUsableNo50% of the viewport
  • A modal, full screen or drawer moves focus in, wraps Tab, locks page scroll and gives focus back on close. A modal or drawer closes on a backdrop click unless closeOnBackdrop: false. maxContentWidth (for example '480px') replaces a modal's width.
  • A banner, slide-in and toast never take focus. Esc closes them only while focus is inside.
  • Under 640 px wide a slide-in becomes a bottom sheet (full width, top corners rounded, at most 85% of the viewport tall), a drawer is full width, a toast is the screen's width minus 32 px, and corner becomes bottom centre.
  • A toast leaves after duration seconds (default 6, 3 to 60). It waits while the pointer or focus is on it or the tab is hidden, and keeps at least 2 seconds after the visitor lets go. A toast timing out resolves closed and records no close event.
  • Banner and slide-in animate over 200 ms. Animation is off for visitors who prefer reduced motion.
  • Screens sit at z-index: 2147483000; the launcher button just below. A toast is role="status"; other formats are role="dialog" with aria-modal true only for blocking ones.

The SDK adds no close button. Give the screen one with the action Close the screen.

On this page