Use themes on a view

By default, the light theme is applied to an app when a user enrolls for the first time. Any subsequent changes to the active theme are stored on the device and should persist through closing and reopening the app.

journey.config methods

Themes can be set and retrieved programmatically using the journey.config namespace in JavaScript/TypeScript. See the journey.config documentation for more details.

View level config

Similar to app-level config, we add support for overriding configuration for a view.

E.g. main.view.config

{
  "themes": [
    {
      "name": "admin",
      "colors": {
        "system": {
          "primary": "lightblue"
        }
      }
    }
  ]
}

Note: View level config does not support defining (or extending) new themes. Overrides can only be applied to themes defined in the app-level config.json.

In the above example, we override the primary color of the admin theme (from crimson to lightblue) and it is important to note that this only applies to the main view in this instance.

All colors and components configuration can be overridden per view for each defined theme.

Last updated