# KpiTile

A tile with a title, a main figure and a trend delta. The delta is colored by whether the change is favourable, so a falling ticket count can show green.

**License needed:** Standard. No premium connector, no PCF, no environment setting.

## Properties

| Property | Type | Default | Notes |
|---|---|---|---|
| Title | Text | Revenue | Caption above the figure |
| Metric | Text | CHF 128,400 | Main figure, format it yourself with `Text()` |
| Delta | Number | 4.2 | Change in percent, sign decides the arrow |
| DeltaCaption | Text | vs. last month | Comparison period |
| HigherIsBetter | Boolean | true | false for figures where a decrease is good |
| MetricColor, PositiveColor, NegativeColor | Color | grey-blue, green, red | |
| IsFavourable (output) | Boolean | | True when the delta moves in the wanted direction |

Width and Height are normal component properties (default 240 x 116).

## Setup

1. Create a component named `KpiTile` and paste `src/KpiTile.pa.yaml`.
2. Insert the component on a screen and set `Title`, `Metric` and `Delta`.
3. See `demo/DemoKpiTile.pa.yaml` for three typical tiles.

## Limits

- Components cannot be placed inside a gallery. Use one instance per tile.
- The figure is plain text, so format numbers before you pass them in.
