Critical Moments Docs
Quick StartHomepageAccount
  • Documentation Home
  • What is Critical Moments?
  • Quick Start
  • Concepts Overview
  • Remote Control / Service
    • Host Config on Github Pages
  • Config File Structure
  • Demo App
  • Homepage & Account
  • 📚Guides
    • Mobile App Toolbox: 13 Features Most Apps Need
    • Reduce App Churn with Notifications
    • Improve your App Store Rating
    • Feature Flags Guide
  • ⏰Notifications
    • Intro to Notifications
    • Notifications Spec
    • Smart Delivery
    • Badges
  • 🎯Conditional Targeting
    • Intro to Conditions
    • Built-in Properties
    • Custom Properties
    • Syntax and Operators
    • Conditional Guides
      • Working with Dates
      • Locations and Weather
      • Event and Property History
  • 🎪Events
    • Event Overview
    • Recommended Events
    • Built-In Events
  • 💬Actions / In App Messaging
    • Actions Overview
    • Modals
      • Modal Content Sections
      • Modal Buttons
      • Modal Images
    • Banners
    • Alerts
    • App Reviews
    • Open Link
    • Custom Actions
    • Conditional Actions
    • Triggers
  • 🎨Themes
    • Theme Overview
    • Built In Themes
  • ⛳Feature Flags
    • Feature Flag Guide
    • Conditional Feature Flags
    • Named Conditions Config
  • 🔑Trustless SaaS
  • 👋Support
  • 👩‍💻SDK API Reference
Powered by GitBook
On this page
  • Examples
  • Config Structure
  • Sample Config

Was this helpful?

  1. Actions / In App Messaging

Modals

Announcements, decisions, and more -- powerful and beautiful messaging with modal UI

Last updated 1 year ago

Was this helpful?

Modals are a pop-over UIs that can be used to present your users with information, or several options in the form of buttons. The modal UI covers the entire app.

  • Powerful configuration-driven UI with support for typography, buttons, images, and symbols

  • Theme support to make the modal feel native to your app/brand look, including dark mode

  • Rich "action" system: buttons can launch other CriticalMoments actions (links, banners) or deep link into native actions in your app

Examples

These examples are all available in our Sample App, including config.

Config Structure

The actionData block has the following options:

  • showCloseButton [bool, optional, default true]: if explicitly set to false, will hide the close button of the modal, and disable any system gestures to dismiss the modal. This forces the user to use a button to dismiss. If used, you should have at least 1 button so it's possible to close the modal.

  • content [object, required]

    • pageType [string, required]: always the value stack. In the future more layouts may be added.

    • pageData [object, required]

Sample Config

Sample confguration for the left most example above, including a "More info" button which launches the brower to provide more information. Our sample app has the config for all of the examples above, and more.

"simpleModalAction": {
    "actionType": "modal",
    "actionData": {
        "content": {
            "pageType": "stack",
            "pageData": {
                "sections": [
                    {
                        "pageSectionType": "image",
                        "pageSectionData": {
                            "imageType": "sf_symbol",
                            "height": 60.0,
                            "imageData": {
                                "symbolName": "coloncurrencysign.square.fill",
                                "weight": "light",
                                "mode": "hierarchical"
                            }
                        }
                    },
                    {
                        "pageSectionType": "title",
                        "pageSectionData": {
                            "title": "Important Announcement"
                        }
                    },
                    {
                        "pageSectionType": "title",
                        "topSpacingScale": 1.5,
                        "pageSectionData": {
                            "title": "New pricing coming soon.",
                            "scaleFactor": 0.64
                        }
                    },
                    {
                        "pageSectionType": "body",
                        "topSpacingScale": 4,
                        "pageSectionData": {
                            "bodyText": "Your free plan won't be impacted! However, if you want to upgrade to 'Pro' now is your last chance to lock in our current pricing."
                        }
                    }
                ],
                "buttons": [
                    {
                        "title": "Got it!",
                        "style": "large"
                    },
                    {
                        "title": "More info",
                        "preventDefault": true,
                        "style": "info",
                        "actionName": "web_link_action"
                    }
                ]
            }
        }
    }
}

Modals are configured as of the type modal .

themeName [string, optional]: a theme name to use for this modal, overriding the default theme. See named themes in . Note: typically you should set one "defaultTheme" in the theme config to be shared by all UI, and not need a customThemeName per modal; this option is available if you need one modal to have a different style.

sections [array, required]: Sections define the content of your modal's view (above the buttons). At least one section is required. See .

buttons [array, optional]: If specified, these buttons will appear on the bottom of the modal. See .

💬
named actions
Themes
documentation for the sections available
the documentation for the buttons
Dark mode with purple accent color, light mode, and a custom theme