---
title: "MicroPDF417 Code"
description: "A small stacked code for packs and tags where a PDF417 is too wide. It holds a lot, a date, or a short record in 1 to 4 columns."
url: https://gelatinui.com/components/micro-pdf417-code
markdown_url: https://gelatinui.com/components/micro-pdf417-code.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/micro-pdf417-code"
version: "2026-11-11"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# MicroPDF417 Code

> A small stacked code for packs and tags where a PDF417 is too wide. It holds a lot, a date, or a short record in 1 to 4 columns.

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

## When to use it

Best for: A lot, a date, or a short record on a small pack or tag, read by a linear or 2D scanner.

- Set `columns` (1 to 4) to fit the label: more columns make a wider, lower code.
- Leave `columns` out for a band about 2 times as wide as high.
- Set `rowHeight` (2 or more modules) for taller rows when the print is rough.

## When not to use it

- For one number that every till reads, use a 1D [Barcode](https://gelatinui.com/components/barcode.md).
- For the facts in words next to the code, add a [Data List](https://gelatinui.com/components/data-list.md).

## Notes for agents

- `fit` fills the width of the parent, in whole px a module when that loses one module or less.
- It holds up to 250 characters, only in 4 columns. Fewer columns hold less: too much data shows a help line.
- `pixelSize` is the outer width. The height follows the rows and `rowHeight`.
- The quiet zone is 1 module. `onError` gets the error.
- `status` sets loading and empty.

## Anatomy

```text
MicroPdf417Code
```

## API reference

### MicroPdf417Code

| 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 lot, a date, a part number. Default width 160px. |
| `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` | MICRO_PDF417_KIND.rowHeight | The row height in whole modules. Default 2, never less (not a number: 2). |
| `columns` | `1 \| 2 \| 3 \| 4` |  | The data columns, 1 to 4. Default: the fewest that make a band 2 times as wide as high. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| MicroPdf417Code | `micro-pdf417-code` |  |  |  |

## Usage

Pass the data. Add `columns` to set the shape.

```tsx title="lot-code.tsx"
import { MicroPdf417Code } from "@/components/pro/labels/micro-pdf417-code";

export function LotCode() {
  return <MicroPdf417Code value="LOT L2611A EXP 2027-04-30" columns={3} pixelSize={168} />;
}
```

## 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/micro-pdf417-code
```

It adds 17 registry items: 16 files, 2084 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

- [Barcode](https://gelatinui.com/components/barcode.md)
- [Data List](https://gelatinui.com/components/data-list.md)
- [Frame](https://gelatinui.com/components/frame.md)

## Accessibility

It is an image named "MicroPDF417 code" by default. Pass `aria-label` to say what it holds, for example "Lot code L2611A".

Print the data as text near the code, so people can read it too.
