> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/sdk-dv-ui/values/list.md). Agents can also search and read this documentation through its [MCP server](https://docs.rierino.com/~gitbook/mcp).

# List

Shows rows as a list of names and values, with an icon and an up or down arrow.

{% tabs %}
{% tab title="Definition" %}

```json
{
  "sources": [{ "key": "orders", "url": "SourceVisData?queryId=orders", "params": {} }],
  "layout": {
    "type": "RCard",
    "props": { "title": "Top cities", "classes": { "rootExtra": "relative h-64" } },
    "items": [
      {
        "type": "RList",
        "bind": {
          "query": "SELECT city, SUM(revenue) AS revenue, SUM(CASE WHEN [month] = '2026-12' THEN revenue ELSE 0 END) - SUM(CASE WHEN [month] = '2026-11' THEN revenue ELSE 0 END) AS trend FROM orders GROUP BY city ORDER BY revenue DESC"
        },
        "props": {
          "icon": "●",
          "nameField": "city",
          "valueField": "revenue",
          "trendField": "trend",
          "valueFormat": {
            "options": { "style": "currency", "currency": "USD", "maximumFractionDigits": 0 }
          }
        }
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Sample data" %}
The rows the dashboard's sources return.

`orders` (30 rows)

```json
[
  { "month": "2026-07", "city": "Boston", "region": "North", "orders": 40, "revenue": 3200 },
  { "month": "2026-07", "city": "Chicago", "region": "North", "orders": 53, "revenue": 3777 },
  { "month": "2026-07", "city": "Austin", "region": "South", "orders": 41, "revenue": 4354 },
  { "month": "2026-07", "city": "Miami", "region": "South", "orders": 54, "revenue": 4931 },
  { "month": "2026-07", "city": "Denver", "region": "West", "orders": 42, "revenue": 5508 },
  { "month": "2026-08", "city": "Boston", "region": "North", "orders": 47, "revenue": 4291 },
  { "month": "2026-08", "city": "Chicago", "region": "North", "orders": 60, "revenue": 4868 },
  { "month": "2026-08", "city": "Austin", "region": "South", "orders": 48, "revenue": 5445 },
  { "month": "2026-08", "city": "Miami", "region": "South", "orders": 61, "revenue": 3622 },
  { "month": "2026-08", "city": "Denver", "region": "West", "orders": 49, "revenue": 4199 },
  { "month": "2026-09", "city": "Boston", "region": "North", "orders": 54, "revenue": 5382 },
  { "month": "2026-09", "city": "Chicago", "region": "North", "orders": 42, "revenue": 5959 },
  { "month": "2026-09", "city": "Austin", "region": "South", "orders": 55, "revenue": 4136 },
  { "month": "2026-09", "city": "Miami", "region": "South", "orders": 43, "revenue": 4713 },
  { "month": "2026-09", "city": "Denver", "region": "West", "orders": 56, "revenue": 5290 },
  { "month": "2026-10", "city": "Boston", "region": "North", "orders": 61, "revenue": 4073 },
  { "month": "2026-10", "city": "Chicago", "region": "North", "orders": 49, "revenue": 4650 },
  { "month": "2026-10", "city": "Austin", "region": "South", "orders": 62, "revenue": 5227 },
  { "month": "2026-10", "city": "Miami", "region": "South", "orders": 50, "revenue": 5804 },
  { "month": "2026-10", "city": "Denver", "region": "West", "orders": 63, "revenue": 3981 },
  { "month": "2026-11", "city": "Boston", "region": "North", "orders": 43, "revenue": 5164 },
  { "month": "2026-11", "city": "Chicago", "region": "North", "orders": 56, "revenue": 5741 },
  { "month": "2026-11", "city": "Austin", "region": "South", "orders": 44, "revenue": 6318 },
  { "month": "2026-11", "city": "Miami", "region": "South", "orders": 57, "revenue": 4495 },
  { "month": "2026-11", "city": "Denver", "region": "West", "orders": 45, "revenue": 5072 },
  { "month": "2026-12", "city": "Boston", "region": "North", "orders": 50, "revenue": 6255 },
  { "month": "2026-12", "city": "Chicago", "region": "North", "orders": 63, "revenue": 4432 },
  { "month": "2026-12", "city": "Austin", "region": "South", "orders": 51, "revenue": 5009 },
  { "month": "2026-12", "city": "Miami", "region": "South", "orders": 64, "revenue": 5586 },
  { "month": "2026-12", "city": "Denver", "region": "West", "orders": 52, "revenue": 6163 }
]
```

{% endtab %}
{% endtabs %}

## Usage

```json
{
  "type": "RList",
  "bind": {
    "query": "SELECT city, SUM(revenue) AS revenue FROM orders GROUP BY city ORDER BY revenue DESC"
  },
  "props": { "icon": "●", "nameField": "city", "valueField": "revenue" }
}
```

Each row of the data is a line: an icon, its name and its value. With a `trendField`, the value gets a green up arrow when the trend is positive and a red down arrow when it's negative. Only the sign matters.

`icon` is text, such as a symbol or an emoji, shown on every line. To show a different one per line, return it from the query and set `iconField`. The list scrolls when its lines don't fit.

`valueFormat` takes the [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) options as `options`, and an optional `locales` (default `en-US`). Without it, values show with two decimals.

## Props

| Prop          | Type                    | Default                                             | Description                                         |
| ------------- | ----------------------- | --------------------------------------------------- | --------------------------------------------------- |
| `nameField`   | `string`                | `"name"`                                            | Field the name is read from.                        |
| `valueField`  | `string`                | `"value"`                                           | Field the value is read from.                       |
| `trendField`  | `string`                | `"trend"`                                           | Field whose sign sets the arrow.                    |
| `icon`        | `string`                |                                                     | Text shown at the start of every line.              |
| `iconField`   | `string`                | `"icon"`                                            | Field the icon is read from, when `icon` isn't set. |
| `valueFormat` | `{ locales?, options }` |                                                     | How the values are formatted.                       |
| `sample`      | `object[]`              | `[{ icon: "●", name: "Name", value: 0, trend: 1 }]` | Rows shown when there is no data, for designing.    |
| `classes`     | `object`                |                                                     | Class names for the parts, see Classes below.       |

In the Rierino designer: **Icon**, **Icon Field**, **Name Field**, **Value Field**, **Value Format**, **Trend Field** and **Classes**.

## Classes

| Part      | Built-in classes                                                          | Styles              |
| --------- | ------------------------------------------------------------------------- | ------------------- |
| `root`    | `overflow-auto h-full`                                                    | The list            |
| `item`    | `items-center grid max-w-full relative py-2 list-grid-columns`            | Each line           |
| `prepend` | `self-center me-3 text-purple-heart text-bold-14`                         | The icon            |
| `content` | `self-center overflow-hidden text-bright-gray text-regular-11 capitalize` | The name            |
| `append`  | `self-center flex items-center text-medium-12 text-purple-heart`          | The value and arrow |

Set `classes.<part>` to replace the built-in classes, or `classes.<part>Extra` to add to them. `rootExtra` is added to each line as well as to the list.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/sdk-dv-ui/values/list.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
