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

# Download

> A button to download data as an Excel file, supports up to 500,000 row downloads via the limit attribute.

<img src="https://mintcdn.com/evidence/Z2CIIsynbphd2HX3/images/components/download/download.png?fit=max&auto=format&n=Z2CIIsynbphd2HX3&q=85&s=740eb48391624dd255dbcd63a73bba61" alt="Basic Usage" width="1000" height="64" data-path="images/components/download/download.png" />

```liquid theme={null}
{% download data="demo.daily_orders" /%}
```

## Examples

### Basic Usage

<img src="https://mintcdn.com/evidence/Z2CIIsynbphd2HX3/images/components/download/download.png?fit=max&auto=format&n=Z2CIIsynbphd2HX3&q=85&s=740eb48391624dd255dbcd63a73bba61" alt="Basic Usage" width="1000" height="64" data-path="images/components/download/download.png" />

```liquid theme={null}
{% download data="demo.daily_orders" /%}
```

### Custom Label and Filename

<img src="https://mintcdn.com/evidence/Z2CIIsynbphd2HX3/images/components/download/example-1.png?fit=max&auto=format&n=Z2CIIsynbphd2HX3&q=85&s=609f822f817d220dc9447aadf4ff2b7e" alt="Custom Label and Filename" width="1000" height="64" data-path="images/components/download/example-1.png" />

```liquid theme={null}
{% download
  data="demo.daily_orders"
  label="Export Orders"
  filename="daily_orders_export"
/%}
```

### With Variant

<img src="https://mintcdn.com/evidence/Z2CIIsynbphd2HX3/images/components/download/example-2.png?fit=max&auto=format&n=Z2CIIsynbphd2HX3&q=85&s=f572827a3030a35fb6f748d58eda91f0" alt="With Variant" width="1000" height="64" data-path="images/components/download/example-2.png" />

```liquid theme={null}
{% download
  data="demo.daily_orders"
  label="Export Data"
  variant="primary"
/%}
```

### With Large Limit

<img src="https://mintcdn.com/evidence/Z2CIIsynbphd2HX3/images/components/download/example-3.png?fit=max&auto=format&n=Z2CIIsynbphd2HX3&q=85&s=b6d619bd936f3376162a0bef8a9df527" alt="With Large Limit" width="1000" height="64" data-path="images/components/download/example-3.png" />

```liquid theme={null}
{% download
  data="demo.daily_orders"
  label="Download Recent Orders"
  limit=50000
/%}
```

## Attributes

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

<ResponseField name="label" type="string" default="Download">
  Text displayed on the download button
</ResponseField>

<ResponseField name="filename" type="string">
  Name of the downloaded file (without extension)
</ResponseField>

<ResponseField name="variant" type="string" default="default">
  Button style variant

  **Allowed values:**

  * `default`
  * `primary`
  * `destructive`
  * `secondary`
  * `ghost`
  * `link`
</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>
