---
title: "MaxiCode"
description: "A parcel sort code of hexagons around a bullseye. A scanner over a fast belt reads it at any angle. It holds up to 93 characters."
url: https://gelatinui.com/components/maxi-code
markdown_url: https://gelatinui.com/components/maxi-code.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/maxi-code"
version: "2026-11-11"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# MaxiCode

> A parcel sort code of hexagons around a bullseye. A scanner over a fast belt reads it at any angle. It holds up to 93 characters.

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

## When to use it

Best for: Parcel sort data that an overhead scanner reads at any angle on a fast belt.

- Put the tracking number, postcode, and sort lane in the value.
- Use `pixelSize` for the outer width. The grid is always 33 rows of 30 hexagons.
- Use `plate={false}` on a white label.

## When not to use it

- For the tracking number that a hand scanner reads, use a 1D [Barcode](https://gelatinui.com/components/barcode.md).
- For the parcel facts on a screen, use 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 draws mode 4 (plain data). It does not make the structured carrier message of modes 2 and 3.
- It holds Latin-1 text only, up to 93 codewords (about 93 letters, or more digits). Other text shows a help line.
- Put the sort lane in large text next to the code too: people at the belt read it, not the code.
- `status` sets loading and empty. `onError` gets the error.

## Anatomy

```text
MaxiCode
```

## API reference

### MaxiCode

| 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 of the parcel, up to 93 characters. 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. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| MaxiCode | `maxi-code` |  |  |  |

## Usage

Pass the parcel data.

```tsx title="sort-code.tsx"
import { MaxiCode } from "@/components/pro/labels/maxi-code";

export function SortCode() {
  return <MaxiCode value="1Z9999AA10123456784 SORT LJU-07" pixelSize={128} />;
}
```

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

It adds 18 registry items: 17 files, 2218 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)
- [Badge](https://gelatinui.com/components/badge.md)

## Accessibility

It is an image named "MaxiCode" by default. Pass `aria-label` to say what it is, for example "Sort code, lane 07".

Print the sort lane in large text next to the code, for the people at the belt.
