---
title: Toggle filter
description: Filter data with a three-state choice.
---

A toggle filter has yes, no, and not-filtering states. Backlit parses `true` and
`1` as yes. It parses `false` and `0` as no. The parsing is not case-sensitive.
Any other value does not apply a filter.

## API

```ts
filters.toggle(name: string): ToggleFilterBuilder
```

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

## Basic toggle filter

Use a toggle when a boolean condition is optional.

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