# Shipping Label

Print-ready 4x6 shipping label with sender, recipient, barcode area, and carrier info.

> 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/shipping-label
```

To install manually, add the dependencies:

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

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

- `components/pdf/blocks/shipping-label/shipping-label.ts`
- `components/pdf/blocks/shipping-label/shipping-label.types.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`
- `components/pdf/pdf-image/pdf-image.ts`
- `components/pdf/qrcode/qrcode.ts`
- `components/pdf/text/text.ts`

## Usage

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

import { ShippingLabelDocument } from "@/components/pdf/blocks/shipping-label/shipping-label";

@Component({
  imports: [ShippingLabelDocument],
  template: `<pdf-shipping-label />`,
})
export class ShippingLabelDemo {}
```

### With a carrier barcode image

Provide `barcodeUrl` to render a full-width barcode image instead of the QR code:

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

import { ShippingLabelDocument } from "@/components/pdf/blocks/shipping-label/shipping-label";
import type { ShippingLabelData } from "@/components/pdf/blocks/shipping-label/shipping-label.types";

@Component({
  imports: [ShippingLabelDocument],
  template: `<pdf-shipping-label [data]="data" />`,
})
export class Label {
  protected readonly data: ShippingLabelData = {
    // ...
    trackingNumber: "1Z999AA10123456784",
    barcodeUrl: "https://example.com/barcodes/1Z999AA10123456784.png",
  };
}
```

## Inputs

| Input   | Type                | Description                                                      |
| ------- | ------------------- | ---------------------------------------------------------------- |
| `data`  | `ShippingLabelData` | Label content: addresses, carrier, tracking, and package details |
| `theme` | `PdfcnTheme`        | Optional theme override                                          |