# BarcodeProps (@salmonui/charts/barcode)

> The BarcodeProps interface of @salmonui/charts/barcode.

Canonical: https://salmonui.dev/docs/reference/charts/barcode/BarcodeProps

```ts
import type { BarcodeProps } from '@salmonui/charts/barcode';
```

Entry index: https://salmonui.dev/docs/reference/charts/barcode (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/charts/barcode.md).

## Reference

Kind: interface

```ts
interface BarcodeProps extends SvgPassthrough {
    readonly type: BarcodeType;
    readonly value: string;
    readonly checksum?: boolean | undefined;
    readonly codeSet?: 'a' | 'b' | 'c' | undefined;
    readonly encoding?: BarcodeDataMatrixEncoding | undefined;
    readonly size?: string | undefined;
    readonly gs1?: boolean | undefined;
    readonly text?: boolean | string | undefined;
    readonly textPosition?: TextPosition | undefined;
    readonly textAlign?: TextAlign | undefined;
    readonly moduleSize?: number | undefined;
    readonly width?: number | undefined;
    readonly height?: number | undefined;
    readonly quietZone?: boolean | undefined;
    readonly color?: string | undefined;
    readonly background?: string | undefined;
    readonly bearerBar?: BearerBar | undefined;
    readonly label?: string | undefined;
    readonly invalidLabel?: string | undefined;
    readonly onInvalid?: ((event: BarcodeInvalidEvent) => void) | undefined;
    readonly ref?: Ref<BarcodeApi> | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
}
```

Members (23):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: BarcodeType;` |  |  |
| `value` | `readonly value: string;` |  | The data to encode. GS1 types take element strings: `(01)09501101530003(10)ABC`. |
| `checksum` | `readonly checksum?: boolean \| undefined;` | optional | Code 39 mod-43 check character (default off); Code 11 C / K check digits (default on). |
| `codeSet` | `readonly codeSet?: 'a' \| 'b' \| 'c' \| undefined;` | optional | Code 128: force one code set instead of automatic switching. |
| `encoding` | `readonly encoding?: BarcodeDataMatrixEncoding \| undefined;` | optional | Data Matrix encodation (default `'auto'`). |
| `size` | `readonly size?: string \| undefined;` | optional | Data Matrix symbol size: `'auto'` (smallest square), `'auto-rectangular'`, or `'<rows>x<cols>'`. |
| `gs1` | `readonly gs1?: boolean \| undefined;` | optional | Data Matrix: GS1 element string with FNC1. |
| `text` | `readonly text?: boolean \| string \| undefined;` | optional | Human-readable text: `true` (default for 1D) shows the encoded value, a string replaces it, `false` hides it. |
| `textPosition` | `readonly textPosition?: TextPosition \| undefined;` | optional |  |
| `textAlign` | `readonly textAlign?: TextAlign \| undefined;` | optional |  |
| `moduleSize` | `readonly moduleSize?: number \| undefined;` | optional | Module (narrow bar) width in px. Default 2 (1D), 4 (Data Matrix). |
| `width` | `readonly width?: number \| undefined;` | optional | Total width in px (overrides `moduleSize`). |
| `height` | `readonly height?: number \| undefined;` | optional | Total height in px (1D). |
| `quietZone` | `readonly quietZone?: boolean \| undefined;` | optional | Keep the quiet zone (default true). |
| `color` | `readonly color?: string \| undefined;` | optional | Bar color: a data color, default `#000000` (scanners need dark on light in every color scheme). |
| `background` | `readonly background?: string \| undefined;` | optional | Background color: a data color, default `#ffffff`. |
| `bearerBar` | `readonly bearerBar?: BearerBar \| undefined;` | optional | ITF-14 bearer bars (default `'frame'` for `itf14`, `'none'` otherwise). |
| `label` | `readonly label?: string \| undefined;` | optional | Accessible name; default the encoded value. |
| `invalidLabel` | `readonly invalidLabel?: string \| undefined;` | optional | Accessible name when the value cannot be encoded (`{reason}` is replaced). Default `Invalid barcode: {reason}`. |
| `onInvalid` | `readonly onInvalid?: ((event: BarcodeInvalidEvent) => void) \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<BarcodeApi> \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
