# Section

Section wrapper with optional title.

> 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/takumi/section
```

To install manually, add the dependencies:

```bash
npm install takumi-pdf @takumi-rs/helpers
```

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

- `components/pdf/section/section.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 { PdfText } from "@/components/pdf/text/text";
import { PdfcnThemeProvider } from "@/components/pdf/theme-provider";
import {
  TakumiDocument,
  TakumiPage,
} from "@/lib/pdf-primitives";

@Component({
  imports: [
    TakumiDocument,
    TakumiPage,
    PdfcnThemeProvider,
    PdfHeading,
    PdfSection,
    PdfText,
  ],
  template: `
    <takumi-document>
      <takumi-page size="A4">
        <pdf-theme-provider>
          <pdf-section spacing="none">
            <pdf-section spacing="lg">
              <pdf-heading [level]="2">Introduction</pdf-heading>
              <pdf-text
                >This section uses generous spacing for a primary document
                area.</pdf-text
              >
            </pdf-section>
            <pdf-section spacing="md">
              <pdf-heading [level]="2">Details</pdf-heading>
              <pdf-text
                >This section groups related content with medium
                spacing.</pdf-text
              >
            </pdf-section>
          </pdf-section>
        </pdf-theme-provider>
      </takumi-page>
    </takumi-document>
  `,
})
export class SectionDemo {}
```

## API Reference

### PdfSection

| Input         | Type                                              | Default     |
| ------------- | ------------------------------------------------- | ----------- |
| `spacing`     | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl'`          | `'md'`      |
| `padding`     | `'none' \| 'sm' \| 'md' \| 'lg'`                  | -           |
| `background`  | `string`                                          | -           |
| `border`      | `boolean`                                         | `false`     |
| `variant`     | `'default' \| 'callout' \| 'highlight' \| 'card'` | `'default'` |
| `accentColor` | `string`                                          | -           |
| `noWrap`      | `boolean`                                         | `false`     |