# Domain Header

> The top of a domain's page, above its DnsRecordTable: the name, registrar and DNS host, the expiry (days left worked out from expires; under 30 days warns, under 7 is danger, autoRenew noted), the SSL state with issuer and end date, and the

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

The top of a domain's page, above its `DnsRecordTable`: the name, registrar and DNS host, the expiry (days left worked out from `expires`; under 30 days warns, under 7 is danger, `autoRenew` noted), the SSL state with issuer and end date, and the mail lights MX, SPF, DKIM and DMARC. `onOpenCheck(check)` makes each cell a button that opens what was found; `actions` go on the right. `DomainList` rows link with `href` / `linkAs`.

## Example

```tsx
import { Button, DnsRecordTable, DomainHeader } from "@twentyfirstmedia/halo";

export default function Preview() {
  return (
    <div className="tf-col" style={{ gap: 16 }}>
      <div className="tf-panel">
        <DomainHeader
          name="northwind.example"
          registrar="Registrar GmbH"
          dns="DNS host"
          expires="2026-05-02T00:00:00Z"
          now="2026-04-16T00:00:00Z"
          autoRenew
          ssl={{
            status: "ok",
            label: "Valid",
            issuer: "Let's Encrypt",
            expires: "2026-06-30T00:00:00Z",
          }}
          mail={{
            mx: { status: "ok", label: "2 servers" },
            spf: { status: "ok", label: "Passes" },
            dkim: { status: "warn", label: "Key older than a year" },
            dmarc: { status: "danger", label: "Missing" },
          }}
          onOpenCheck={() => {}}
          actions={
            <Button size="sm" variant="secondary" icon="plus">
              Add record
            </Button>
          }
        />
      </div>
      <div className="tf-panel tf-panel-flush">
        <DnsRecordTable
          records={[
            { id: 1, type: "A", name: "@", content: "203.0.113.7", ttl: "Auto", proxy: true },
            {
              id: 2,
              type: "MX",
              name: "@",
              content: "10 mx1.mail.example",
              ttl: "3600",
              proxy: null,
            },
            {
              id: 3,
              type: "TXT",
              name: "@",
              content: "v=spf1 include:_spf.mail.example ~all",
              ttl: "3600",
              proxy: null,
            },
          ]}
        />
      </div>
    </div>
  );
}
```

## Props

### DomainHeader

| Prop | Type | Notes |
| --- | --- | --- |
| `name` | `string` | Required |
| `registrar?` | `ReactNode` |  |
| `dns?` | `ReactNode` |  |
| `expires?` | `Date \| string \| number` | Expiry date (formatted in the provider's locale). |
| `days?` | `number` | Days until expiry; worked out from `expires` when omitted. Under 30 warns, under 7 is danger. |
| `autoRenew?` | `boolean` |  |
| `ssl?` | `DomainHeaderCheck & { expires?: Date \| string \| number; issuer?: ReactNode }` |  |
| `mail?` | `{ mx?: DomainHeaderCheck; spf?: DomainHeaderCheck; dkim?: DomainHeaderCheck; dmarc?: DomainHeaderCheck; }` | The mail lights. |
| `onOpenCheck?` | `(check: "mx" \| "spf" \| "dkim" \| "dmarc" \| "ssl" \| "expiry") => void` |  |
| `actions?` | `ReactNode` | Buttons on the right (renew, add record). |
| `now?` | `Date \| string \| number` | What counts as today for `days` (default now). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### DnsRecordTable

| Prop | Type | Notes |
| --- | --- | --- |
| `records` | `DnsRecord[]` | Required |
| `rowMenu?` | `(r: DnsRecord) => (MenuItem \| "-")[]` |  |
| `selectable?` | `boolean` |  |
| `bulkActions?` | `BulkAction<DnsRecord>[]` |  |
| `toolbar?` | `ReactNode` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
