---
title: "Micro QR Code"
description: "A small QR code with one corner square, for short IDs on parts and labels. It holds up to 35 digits or 21 characters."
url: https://gelatinui.com/components/micro-qr-code
markdown_url: https://gelatinui.com/components/micro-qr-code.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/micro-qr-code"
version: "2026-11-11"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Micro QR Code

> A small QR code with one corner square, for short IDs on parts and labels. It holds up to 35 digits or 21 characters.

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

## When to use it

Best for: A short ID on a part or label with too little room for a QR code.

- Use it for IDs of 21 characters or less, or 35 digits or less.
- Use `pixelSize` to set the outer width, quiet zone included.
- Use `plate={false}` on a white label.

## When not to use it

- For a long ID on a narrow strip, 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.
- The symbol is 11 to 17 modules and grows with the data. The quiet zone is 2 modules.
- Most phone cameras do not read Micro QR. Use it for industrial scanners only.
- Too much data shows a help line, not a code. `onError` gets the error.
- `status` sets loading and empty. Each code is an image named by its kind; pass `aria-label`.

## Anatomy

```text
MicroQrCode
```

## API reference

### MicroQrCode

| 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. A short ID, 21 characters or less. Default size 96px. |
| `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 |
| --- | --- | --- | --- | --- |
| MicroQrCode | `micro-qr-code` |  |  |  |

## Usage

Pass the short ID.

```tsx title="asset-code.tsx"
import { MicroQrCode } from "@/components/pro/labels/micro-qr-code";

export function AssetCode() {
  return <MicroQrCode value="NW-0042" pixelSize={64} aria-label="Asset code NW-0042" />;
}
```

## 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-qr-code
```

It adds 17 registry items: 16 files, 2053 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 "Micro QR code" by default. Pass `aria-label` to say what it holds, for example "Asset code NW-0042".

Show the ID as text next to the code, so people can read it too.
