# Link

Clickable link styled for PDF documents.

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

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

@Component({
  imports: [
    TakumiDocument,
    TakumiPage,
    PdfcnThemeProvider,
    PdfLink,
    PdfSection,
  ],
  template: `
    <takumi-document>
      <takumi-page size="A4">
        <pdf-theme-provider>
          <pdf-section spacing="none">
            <pdf-link href="https://pdfcn.dev">Documentation</pdf-link>
            <pdf-link href="#section-1" color="primary">Internal link</pdf-link>
          </pdf-section>
        </pdf-theme-provider>
      </takumi-page>
    </takumi-document>
  `,
})
export class LinkDemo {}
```

## API Reference

### PdfLink

| Input       | Type                                | Default     |
| ----------- | ----------------------------------- | ----------- |
| `href`      | `string`                            | -           |
| `align`     | `'left' \| 'center' \| 'right'`     | `'left'`    |
| `color`     | `string`                            | -           |
| `variant`   | `'default' \| 'muted' \| 'primary'` | `'default'` |
| `underline` | `'always' \| 'none'`                | `'always'`  |