# Text

Body text with typography variants.

> 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/text
```

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/text/text.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 { 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,
    PdfSection,
    PdfText,
  ],
  template: `
    <takumi-document>
      <takumi-page size="A4">
        <pdf-theme-provider>
          <pdf-section spacing="none">
            <pdf-text
              >Default body text for paragraphs, descriptions, and document
              content.</pdf-text
            >
            <pdf-text variant="xs" color="mutedForeground"
              >Caption text for metadata and supporting details.</pdf-text
            >
            <pdf-text variant="lg"
              >Lead paragraph with a larger typographic scale.</pdf-text
            >
          </pdf-section>
        </pdf-theme-provider>
      </takumi-page>
    </takumi-document>
  `,
})
export class TextDemo {}
```

## API Reference

### PdfText

| Input        | Type                                                       | Default    |
| ------------ | ---------------------------------------------------------- | ---------- |
| `variant`    | `'xs' \| 'sm' \| 'base' \| 'lg' \| 'xl' \| '2xl' \| '3xl'` | `'base'`   |
| `align`      | `'left' \| 'center' \| 'right' \| 'justify'`               | `'left'`   |
| `color`      | `string`                                                   | -          |
| `weight`     | `'normal' \| 'medium' \| 'semibold' \| 'bold'`             | `'normal'` |
| `italic`     | `boolean`                                                  | `false`    |
| `decoration` | `'underline' \| 'line-through' \| 'none'`                  | `'none'`   |
| `transform`  | `'uppercase' \| 'lowercase' \| 'capitalize'`               | -          |
| `noMargin`   | `boolean`                                                  | `false`    |