# Heading

Document headings with typographic scale.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any docs URL. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

## Installation

```bash
npx shadcn@latest add @angular-pdfcn/forme/heading
```

To install manually, add the dependencies:

```bash
npm install @formepdf/core @formepdf/shared
```

Then copy these files into your project and update the import paths to match your setup:

- `components/pdf/heading/heading.ts`
- `lib/resolve-color.ts`
- `components/pdf/theme-provider.ts`
- `lib/pdf-renderer.ts`
- `lib/pdf-primitives.ts`
- `lib/render.ts`
- `lib/pdf-themes/professional.ts`
- `lib/pdf-themes/primitives.ts`
- `types/pdf-themes.ts`
- `types/pdf-components.ts`

## Usage

```ts
import { Component } from "@angular/core";

import { PdfHeading } from "@/components/pdf/heading/heading";
import { PdfSection } from "@/components/pdf/section/section";
import {
  FormeDocument,
  FormePage,
} from "@/lib/pdf-primitives";

@Component({
  imports: [FormeDocument, FormePage, PdfHeading, PdfSection],
  template: `
    <forme-document>
      <forme-page size="A4" [margin]="30">
        <pdf-section spacing="none">
          <pdf-heading [level]="1">Main Title</pdf-heading>
          <pdf-heading [level]="2" align="center" color="primary"
            >Subtitle</pdf-heading
          >
          <pdf-heading [level]="3" [style]="{ color: '#1e3a5f' }"
            >Custom Styled</pdf-heading
          >
        </pdf-section>
      </forme-page>
    </forme-document>
  `,
})
export class HeadingDemo {}
```

## API Reference

### PdfHeading

| Input          | Type                                                    | Default    |
| -------------- | ------------------------------------------------------- | ---------- |
| `level`        | `1 \| 2 \| 3 \| 4 \| 5 \| 6`                            | `1`        |
| `align`        | `'left' \| 'center' \| 'right'`                         | `'left'`   |
| `color`        | `string`                                                | -          |
| `transform`    | `'uppercase' \| 'lowercase' \| 'capitalize'`            | -          |
| `weight`       | `'normal' \| 'medium' \| 'semibold' \| 'bold'`          | `'bold'`   |
| `tracking`     | `'tighter' \| 'tight' \| 'normal' \| 'wide' \| 'wider'` | `'normal'` |
| `noMargin`     | `boolean`                                               | `false`    |
| `keepWithNext` | `boolean`                                               | -          |