# Section Header

Heads a section: a 32 px icon tile, a 14 px title with a muted line straight under it, 10 px apart, and optional controls on the right.

- Beta: ready to use; its API can still change in a minor release.
- Category: Layout & surfaces

```tsx
import { SectionHeader } from "@leap-crm/design-system";
```

## Best practices

- Do: Use it to head a section inside a page or panel, like Relationships on a contact, with its Add button in `action`.
- Do: Set `level` so the title fits the page's outline: 3 under a panel's title, 2 when the section sits straight under the page heading.
- Do: Pick the icon tile's `tone` for what the section is about, and keep the same tone for that section everywhere it appears.
- Don't: Use it at the top of a drawer or dialog. Use `DrawerHeader`, or `DialogHeader` with `DialogTitle`, which name the popup for screen readers and wire its close button.
- Don't: Use it for a quiet label over a small group. Use `Eyebrow`, so the section headings stay the strongest text in the panel.

## Related

- [Panel Header](./panel-header.md)
- [Step Header](./step-header.md)
- [Eyebrow](./eyebrow.md)
- [Collapsible](./collapsible.md)

## Examples

What the examples import:

```tsx
import { Folder, Link, Plus } from "lucide-react";
import { Button, SectionHeader } from "@leap-crm/design-system";
```

### With a subtitle

```tsx
<SectionHeader
  icon={<Link />}
  title="Relationships"
  subtitle="People connected to Jane Citizen"
/>
```

### With an action

The section's Add sits on the right.

```tsx
<SectionHeader
  className="w-120"
  icon={<Folder />}
  title="Documents"
  subtitle="Files shared with this opportunity"
  action={
    <Button intent="outline" size="sm" icon={<Plus />}>
      Add
    </Button>
  }
/>
```

### Title only

```tsx
<SectionHeader icon={<Folder />} title="Documents" />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `icon` | `ReactNode` |  | The 16 px icon in the 32 px tile on the left. |
| `tone` | `Exclude<Tone, "default" \| "plum"> \| "neutral"` | `"info"` | The icon tile's colour, as IconTile. |
| `title` (required) | `ReactNode` |  | The section's name. |
| `subtitle` | `ReactNode` |  | One muted line straight under the title. |
| `action` | `ReactNode` |  | Controls on the right, like an Add button. |
| `level` | `2 \| 3 \| 4` | `3` | The heading level the title takes in the page's outline. |
| `className` | `string` |  | Classes added to the root element, merged with its own. Tokens only. |
