---
title: "Stats"
description: "KPI row from a table |Label|Value|Delta|Note."
---

> 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.

# Stats

```gistui
root = Stats(kpis)
kpis = |Label|Value|Delta|Note
|Revenue|$1.2M|+8%|vs Q2
|Customers|3,410|+2.1%|vs Q2
|Churn|1.8%|-0.4pt|vs Q2
```

## Signature

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

```gistui
Stats(data:data)
```

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

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `data` | table | positional, required |  |

## 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({ Stats: MyStats });
<GistUI library={lib} stream={response.body} />;
```
### Vue

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

```svelte
<GistUI source={answer} components={{ Stats: MyStats }} />
```
### Solid

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

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

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

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

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