> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Banners

> Show short Flatpeak messages in your app: build a placeholder, render the banner, handle the tap.

A banner is a short text message Flatpeak places in your app: an offer from a supplier or a VPP operator, or a notice about the user's tariff. You build the placeholder, and Flatpeak decides what it shows.

![A banner: a bolt icon, one line of text and a chevron](https://mintcdn.com/flatpeak-d495c19e/2B6nWUU4-c2pSD3E/images/busbar/connect/banner.png?fit=max\&auto=format\&n=2B6nWUU4-c2pSD3E\&q=85\&s=8efd1a4116a4c865a9f882169d3d1a73)

## Build the placeholder

1. When your app starts, [create a Connect session](/docs/energy-api/reference/connect-sessions/create.md) for the device and pass its ID to the app. Create another when it expires or after a tap.
2. Add a placeholder to any screen. It takes no space when empty.
3. When the screen opens, call the [banner route](/docs/energy-api/reference/connect/tariff/banner.md) with the session ID. Pass `placement`, the kind of screen: `HOME`, `DEVICE`, `SCHEDULE`, `INSIGHTS`, `SETTINGS` or `OTHER`.
4. If `banner` is `null`, show nothing; otherwise show it.

## Render

| Field | Do |
| :- | :- |
| `text` | Show it in your own font. Up to 120 characters |
| `icon` | Map it to your icon set, or leave it out |
| `background_color`, `text_color` | Use them, or your own style where they are `null` |
| `end_time` | Stop showing a cached banner at this time |

## Handle the tap

A banner is tappable when `actions` lists `CLICK`.

1. Send the `CLICK` action with the banner ID and the `placement` it was tapped in.
2. Connect answers with a route. On [`session_redirect`](/docs/energy-api/reference/connect/tariff/redirects), send the user to `redirect_url`. On any other route, render that Connect page.
3. Create a new session for the next banner request.

## Dismiss

When the user closes a banner, send the `DISMISS` action. Flatpeak stops returning it for the device.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.