# Mail Filter Bar

> Filters for a mail list in one row: account and domain (menus), unread, starred and with attachments (toggles), and the agent that handled the mail.

Component · Data · Halo kit · [Live page](https://ui.twentyfirst.media/halo/components/MailFilterBar/)

Filters for a mail list in one row: account and domain (menus), unread, starred and with attachments (toggles), and the agent that handled the mail. "Clear filters" appears when any is set; `count` shows how many messages match. The value is `{ account, domain, agent, unread, starred, attachments }`.

## Example

```tsx
import { MailFilterBar } from "@twentyfirstmedia/halo";

export default function Preview() {
  return (
    <div className="tf-panel" style={{ minHeight: 320 }}>
      <MailFilterBar
        defaultValue={{ unread: true, domain: "example.com" }}
        accounts={[
          { value: "mara@example.com", label: "mara@example.com" },
          { value: "support@example.com", label: "support@example.com" },
          { value: "billing@example.com", label: "billing@example.com" },
        ]}
        domains={[
          { value: "example.com", label: "example.com" },
          { value: "example.org", label: "example.org" },
        ]}
        agents={[
          { value: "support", label: "Support agent" },
          { value: "bookkeeper", label: "Bookkeeper" },
        ]}
        count={18}
      />
    </div>
  );
}
```

## Props

### MailFilterBar

| Prop | Type | Notes |
| --- | --- | --- |
| `value?` | `MailFilters` |  |
| `defaultValue?` | `MailFilters` |  |
| `onChange?` | `(filters: MailFilters) => void` |  |
| `accounts?` | `Option[]` |  |
| `domains?` | `Option[]` |  |
| `agents?` | `Option[]` | Agents mail can be filtered by (mail an agent handled or drafted). |
| `count?` | `number` | Messages matching, shown at the end. |
| `label?` | `string` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
