Banners

Announcements that appear across every screen in your app

Banners are a powerful way to push critical information to your users.

Tapping a banner can trigger other actions, like showing a modal with more information, opening a web-link to an announcement, or showing an alert.

Examples

A bottom banner, top banner with cycle-message button, and a themed bottom banner

Banners have actionType banner and an actionData object with the following keys:

  • body [string, required]: the string to show in the banner

  • showDismissButton [bool, optional]: if true, a close button ("X") is shown, allowing the user to dismiss this banner. If false, the banner can not be dismissed. Defaults to true if omitted.

  • maxLineCount [int, optional]: if set, limits the number of lines. If omitted, defaults to 4 lines. If the max line count is reached, the string will be truncated with an ellipsis ("..."). If set to 0, the line count isn't limited (although the banner is limited to 20% of screen height).

  • tapActionName [string, optional]: the name of an action to trigger if the user taps the banner message. No action is fired if omitted.

  • themeName [string, optional]: if provided this banner will use the specified theme (overriding the default theme). See themeing information below.

  • preferredPosition [string, optional]: one of "top" or "bottom". For a given app, it's best to not mix positions. If both are used the banner area will use the position of the last banner presented.

Design Considerations

Banners show a message across every screen of your app, and should be used sparingly for important announcements.

Only convey the most critical information in the banner text itself, keeping it as short as possible. Provide more detailed information if they tap the banner with a modal, alert or web-link in embedded browser launched via tapActionName. If you have a tap action, consider ending your body string with "Tap for details.", or a similar hint.

Banners should almost always be user dismissable, allowing users to reclaim the screen space. Exceptions to this rule should be exceedingly rare (example: company is shutting down and users need to export data).

If you present multuple banners at the same time, the user will see a "<>" button on the left of the banner to cycle through the messages. You can try this in our Sample App.

Theming Banners

Banners respect your default theme, or you can a theme for a specific banner with the themeName property.

There are 2 specific properties in themes for banners:

  • bannerBackgroundColor: the banner background color

  • bannerForegroundColor: the foreground color for text and buttons

By default, banners are yellow with black text, in the system font.

Banners will respect shared theme properties, like the fontName. See the full themes documentation for details.

Example Config

The config below from the Sample App, and generated the banners in the screenshots above.

Last updated

Was this helpful?