---
title: Period filter
description: Select a calendar unit for grouped data.
---

A period filter selects one calendar unit. Use it when a view can group data by
week, month, quarter, or year. Backlit accepts only a unit declared by the
filter.

## API

```ts
filters.period(name: string, units: PeriodUnit[]): PeriodFilterBuilder
```

The available units are `week`, `month`, `quarter`, and `year`.

| Method     | Input    | Result                         |
| ---------- | -------- | ------------------------------ |
| `setLabel` | `string` | Sets the filter-control label. |

## Basic period filter

<BacklitExample path="filters/period/basic" view="list" />
