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

# Heat Grid

> Display a grid of color-coded cells based on metric thresholds

```liquid theme={null}
{% heat_grid
  data="appointments"
  dimension="province"
  value="avg(wait_time)"
  thresholds=[60, 90]
  units="MIN"
  lower_is_better=true
/%}
```

## Examples

### Basic Usage

```liquid theme={null}
{% heat_grid
  data="appointments"
  dimension="province"
  value="avg(wait_time)"
  thresholds=[60, 90]
  units="MIN"
  lower_is_better=true
/%}
```

## Attributes

<ResponseField name="data" type="string" required>
  Table or view to query
</ResponseField>

<ResponseField name="dimension" type="string" required>
  Column for cell labels (e.g., province)
</ResponseField>

<ResponseField name="value" type="string" required>
  SQL aggregation expression for the metric (e.g., avg(wait\_time))
</ResponseField>

<ResponseField name="thresholds" type="array" required>
  Two numeric thresholds creating 3 color zones: \[low, high]. Values below low are zone 1, between low and high are zone 2, at or above high are zone 3.
</ResponseField>

<ResponseField name="units" type="string">
  Units label shown below the value in each cell (e.g., "MIN")
</ResponseField>

<ResponseField name="fmt" type="string">
  Format code for the metric value. See [Value Formatting](/core-concepts/value-formatting) for available formats.
</ResponseField>

<ResponseField name="title" type="string">
  Component title
</ResponseField>

<ResponseField name="lower_is_better" type="boolean">
  If true, low values are green and high values are red. Default (false) means high values are green.
</ResponseField>

<ResponseField name="compact" type="boolean">
  If true, removes gaps and borders between cells and applies a single border radius to the outer grid.
</ResponseField>

<ResponseField name="filters" type="array">
  IDs of filters to apply to the query
</ResponseField>

<ResponseField name="where" type="string">
  Custom SQL WHERE condition to apply to the query. For date filters, use date\_range instead.
</ResponseField>

<ResponseField name="having" type="string">
  Custom SQL HAVING condition to apply to the query after GROUP BY
</ResponseField>

<ResponseField name="limit" type="number">
  Maximum number of rows to return from the query. Note: When used with tables, limit will disable subtotals to prevent incomplete subtotal rows.
</ResponseField>

<ResponseField name="order" type="string">
  Column name(s) with optional direction (e.g. "column\_name", "column\_name desc")
</ResponseField>

<ResponseField name="qualify" type="string">
  Custom SQL QUALIFY condition to filter windowed results
</ResponseField>

<ResponseField name="width" type="number">
  Set the width of this component (in percent) relative to the page width
</ResponseField>
