---
title: "PDF417 Code"
description: "A wide stacked code for printed boarding passes, driving licences, and ID cards. It holds a whole record, and you set its rows and columns."
url: https://gelatinui.com/components/pdf417-code
markdown_url: https://gelatinui.com/components/pdf417-code.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/pdf417-code"
version: "2026-11-11"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# PDF417 Code

> A wide stacked code for printed boarding passes, driving licences, and ID cards. It holds a whole record, and you set its rows and columns.

Page: https://gelatinui.com/components/pdf417-code

## When to use it

Best for: A printed pass or card whose data a line scanner reads: boarding passes, licences, and ID cards.

- Use it for the IATA BCBP data of a boarding pass or the AAMVA data of a licence.
- Use `rowHeight` for taller rows, in whole modules (3 or more).
- Use `columns` (1 to 30) for a taller or a lower band, for example to fit the back of a card.
- Use `plate={false}` when the code sits on your own white paper or card.

## When not to use it

- For a ticket on a phone screen, use an [Aztec Code](https://gelatinui.com/components/aztec-code.md).
- For a link that any phone camera opens, use a [QR Code](https://gelatinui.com/components/qr-code.md).
- For a small square code on a tag, use a [Data Matrix Code](https://gelatinui.com/components/data-matrix-code.md).

## Notes for agents

- `fit` fills the width of the parent, in whole px a module when that loses one module or less.
- `pixelSize` is the outer width, the quiet zone of 2 modules included. The default is 320px; the height follows the rows.
- With no `columns`, the band takes the fewest data columns that make it 2.5 times as wide as high (with rows 3 modules high).
- A long value with no `columns` makes a wide band with thin modules: set `columns` or a larger `pixelSize`.
- `rowHeight` under 3 or not a number draws rows 3 modules high.
- Too much data (925 codewords, about 1,500 characters of text) shows a help line, not a code, and calls `onError`.
- The default name is always "PDF417 code". Pass `aria-label` with whose pass it is.

## Anatomy

```text
Pdf417Code
```

## API reference

### Pdf417Code

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `aria-label` | `string` |  | Defines a string value that labels the current element. The accessible name. Default the kind ("Data Matrix code"), or "<kind>: <value>" for a link. |
| `value` | `string` |  | The data etiket encodes. The data: a boarding pass (BCBP) string, or the fields of an ID card. Default width 320px. |
| `pixelSize` | `number` |  | The outer width in px, quiet zone included. The height follows the symbol. |
| `fit` | `boolean` |  | Fill the width of the parent, in whole px a module when that loses one module or less (the QR Code rule), else the exact width. Default false. Wide codes (postal, PDF417) on a phone. |
| `plate` | `boolean` |  | The light plate under the code. Default true. |
| `status` | `DataStatus` |  | The load state. Default `ready`. `loading`: the skeleton while the value is not known yet. `empty`: the empty box. `error` shows as `ready`: the error box is for a value the code cannot hold. |
| `labels` | `Partial<CodeSymbolLabels>` |  | The texts of the empty and error states. |
| `onError` | `function` |  | Runs once for each new error (too much data, a character the kind cannot hold), after commit. It does not run again for the same error, and typed values are deferred: a field that shows the error should derive it from the value with the kind's encoder (cached, so free), not clear it on each change. |
| `rowHeight` | `number` | PDF417_KIND.rowHeight | The row height in whole modules. Default 3, never less (not a number: 3). |
| `columns` | `number` |  | The data columns, 1 to 30. Default: the fewest that make a band 2.5 times as wide as high. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Pdf417Code | `pdf417-code` |  |  |  |

## Usage

Pass the BCBP data of the boarding pass.

```tsx title="boarding-pass-code.tsx"
import { Pdf417Code } from "@/components/pro/labels/pdf417-code";

export function BoardingPassCode() {
  return (
    <Pdf417Code
      value="M1NOVAK/MILA          EABC123 LJUFRANW 0412 315Y012A0042 100"
      aria-label="Boarding pass code: Mila Novak"
    />
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/pdf417-code
```

It adds 17 registry items: 16 files, 2093 lines, and the npm packages `@mantine/hooks`, `clsx`, `etiket`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Aztec Code](https://gelatinui.com/components/aztec-code.md)
- [Data Matrix Code](https://gelatinui.com/components/data-matrix-code.md)
- [Barcode](https://gelatinui.com/components/barcode.md)
- [QR Code](https://gelatinui.com/components/qr-code.md)

## Accessibility

It is an image named "PDF417 code" by default. Pass `aria-label` to say whose pass or card it is.

Show the name, the flight, and the seat as text on the pass too.
