---
title: "Stat"
description: "One KPI."
---

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

# Stat

```gistui
root = Grid(Stat("Monthly recurring revenue", "$482.3k", "+12.4%", note:"vs last month", icon:dollar, spark:[310, 328, 351, 380, 402, 431, 482]), Stat("Logo churn", "1.8%", "-0.4pt", note:"lower is better", icon:users, invert), cols:2)
```

## Signature

This is the line a model reads in the system prompt.

```gistui
Stat(label, value, delta?, note:str, icon:Icon2, spark:[num], invert)
```

- **Group:** Data
- **Children:** No
- **Positional arguments:** `label`, `value`, `delta?` (a trailing `?` means it may be left out)

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `label` | string | positional, required |  |
| `value` | string | positional, required |  |
| `delta` | string | positional, optional |  |
| `note` | string | named: `note:…` |  |
| `icon` | name (open list) | named: `icon:…` | Also accepts `money`, `revenue`, `price`, `cost`, `payment`, `chart`, `analytics`, `trend`, `growth`, `decline`, `people`, `team`, `customers`, `person`, `company`, `office`, `location`, `place`, `travel`, `flight`, `food`, `restaurant`, `time`, `date`, `email`, `chat`, `security`, `idea`, `ai`, `launch`, `speed`, `energy`, `warning`, `error`, `success`, `video`, `movie`, `streaming`, `game`, `education`, `nature`, `health`, `legal`, `document`, `photo`, `shop`, `shopping`, `house`, `storage`, `api`, `winner`, `goal`, `sunny`, `clear`, `cloudy`, `partly-cloudy`, `rain`, `rainy`, `snow`, `storm`, `thunder`, `temperature`, `takeoff`, `departure`, `landing`, `arrival`, `baggage`, `seat`, `bag`. |
| `spark` | list of number | named: `spark:…` | sparkline values |
| `invert` | flag | bare word: `invert` | lower is better (churn, cost) |

## Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model's output do not change.

### React

```tsx
import { ui } from "@gistui/react/ui";

const lib = ui.extend({ Stat: MyStat });
<GistUI library={lib} stream={response.body} />;
```
### Vue

```vue
<GistUI :source="answer" :components="{ Stat: MyStat }" />
```
### Svelte

```svelte
<GistUI source={answer} components={{ Stat: MyStat }} />
```
### Solid

```tsx
<GistUI source={answer()} components={{ Stat: MyStat }} />
```
### Vanilla

```ts
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ Stat: (ctx) => ({ el: myElement(ctx) }) });
```

See [Custom components](/docs/guides/custom-components/) for the full contract. Style hook: `[data-gistui="Stat"]`.

Source: https://gistui.com/docs/components/data/stat/index.mdx
