# BarcodeSymbol Interface

> BarcodeSymbol interface in the TX Sheet Control TypeScript API for the browser, with its syntax and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Interface
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > BarcodeSymbol Interface
- **750 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/llms-full.txt

---

Detached binary symbol returned by encodeBarcode. Rows exclude the mandatory quiet zone.

Package: `@txtextcontrol/tx-sheet-control`.

### Syntax

```typescript
interface BarcodeSymbol {
    rows: boolean[][];
    text: string;
    quietZone: number;
    isMatrix: boolean;
}
```

### Remarks

Settings are detached snapshots. Cell values and formulas remain available beneath the symbol. Sources resolve after calculation and mail merge. See [Barcodes and QR Codes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/barcodes/llms-full.txt) for validation, supported payloads and XLSX behavior.

- [rows](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/rows-property/llms-full.txt) — Detached module rows; true denotes a dark module. The quiet zone is excluded.
- [text](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/text-property/llms-full.txt) — Human-readable payload, including any generated EAN or UPC check digit.
- [quietZone](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/quietzone-property/llms-full.txt) — Required quiet-zone width in modules: 4 for QR and at least 10 for linear codes.
- [isMatrix](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/ismatrix-property/llms-full.txt) — True for QR codes; false for linear symbols.

### Examples

Create a barcode from application data and retain its editable workbook settings.

```typescript
import { encodeBarcode } from '@txtextcontrol/tx-sheet-control';
import type { BarcodeSymbol, BarcodeSymbology } from '@txtextcontrol/tx-sheet-control';

const symbology: BarcodeSymbology = 'qrCode';
const symbol: BarcodeSymbol = encodeBarcode({ symbology, value: 'Invoice 1042' });
const canvas = document.createElement('canvas');
const moduleSize = 4;
canvas.width = (symbol.rows[0].length + symbol.quietZone * 2) * moduleSize;
canvas.height = (symbol.rows.length + symbol.quietZone * 2) * moduleSize;
canvas.setAttribute('aria-label', symbol.text);
canvas.dataset.symbolType = symbol.isMatrix ? 'matrix' : 'linear';
const context = canvas.getContext('2d')!;
context.fillStyle = '#ffffff';
context.fillRect(0, 0, canvas.width, canvas.height);
context.fillStyle = '#000000';
symbol.rows.forEach((row, y) => row.forEach((isDark, x) => {
    if (isDark) context.fillRect((x + symbol.quietZone) * moduleSize, (y + symbol.quietZone) * moduleSize, moduleSize, moduleSize);
}));
document.body.append(canvas);
```

---

## In This Section

- [BarcodeSymbol.isMatrix Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/ismatrix-property/llms-full.txt): BarcodeSymbol.isMatrix property in the TX Sheet Control TypeScript API for the browser: True for QR codes; false for linear symbols.
- [BarcodeSymbol.quietZone Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/quietzone-property/llms-full.txt): BarcodeSymbol.quietZone property in the TX Sheet Control TypeScript API for the browser, with its type number and a TypeScript example.
- [BarcodeSymbol.rows Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/rows-property/llms-full.txt): BarcodeSymbol.rows property in the TX Sheet Control TypeScript API for the browser, with its type boolean[][] and a TypeScript example.
- [BarcodeSymbol.text Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/text-property/llms-full.txt): BarcodeSymbol.text property in the TX Sheet Control TypeScript API for the browser: Human-readable payload, including any generated EAN or UPC check digit.

---

## Nearby

- **Previous:** [BarcodeDrawingOptions.rotation Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodedrawingoptions/rotation-property/llms-full.txt)
- **Next:** [BarcodeSymbol.rows Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/barcodesymbol/rows-property/llms-full.txt)
