> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autype.com/llms.txt
> Use this file to discover all available pages before exploring further.

# QR Codes

> Generate URL, WiFi, and vCard QR codes directly in your documents with customizable size and error correction.

Autype can embed QR codes in your documents using the `:::qrcode` directive. QR codes are rendered as images in the exported document.

## URL QR Code

```markdown theme={null}
:::qrcode{type="url" size=150 align=center}
https://example.com
:::
```

You can also use the `url:` prefix:

```markdown theme={null}
:::qrcode{type="url" size=200}
url: https://docs.autype.com
:::
```

Both formats are equivalent. If the content doesn't start with `url:`, the entire first line is used as the URL.

***

## WiFi QR Code

Generate a QR code that lets users connect to a WiFi network by scanning:

```markdown theme={null}
:::qrcode{type="wifi" size=200}
ssid: MyNetwork
password: secret123
encryption: WPA
:::
```

### WiFi fields

| Field        | Required | Values                 | Description                   |
| ------------ | -------- | ---------------------- | ----------------------------- |
| `ssid`       | Yes      | String                 | Network name                  |
| `password`   | No       | String                 | Network password              |
| `encryption` | No       | `WPA`, `WEP`, `nopass` | Encryption type               |
| `hidden`     | No       | `true`, `false`        | Whether the network is hidden |

### Example: Guest WiFi

```markdown theme={null}
:::qrcode{type="wifi" size=150}
ssid: GuestWiFi
password: guest2024
encryption: WPA
hidden: false
:::
```

***

## vCard QR Code

Generate a contact card QR code:

```markdown theme={null}
:::qrcode{type="vcard" size=180}
firstName: John
lastName: Doe
organization: Acme Corp
phone: +1-555-123-4567
email: john.doe@example.com
url: https://johndoe.com
address: 123 Main St, City, Country
:::
```

### vCard fields

| Field          | Required | Description                            |
| -------------- | -------- | -------------------------------------- |
| `firstName`    | No       | First name                             |
| `lastName`     | No       | Last name                              |
| `name`         | No       | Full name (auto-split into first/last) |
| `phone`        | No       | Phone number                           |
| `email`        | No       | Email address                          |
| `organization` | No       | Company / organization name            |
| `url`          | No       | Website URL                            |
| `address`      | No       | Physical address                       |
| `note`         | No       | Additional note                        |

<Note>
  The `name` field is a shortcut that splits on the first space into `firstName` and `lastName`. Use `firstName` and `lastName` separately for more control.
</Note>

### Minimal vCard

```markdown theme={null}
:::qrcode{type="vcard"}
firstName: Jane
lastName: Smith
email: jane@company.com
phone: +49-123-456789
:::
```

***

## Attribute reference

| Attribute         | Values                    | Description               |
| ----------------- | ------------------------- | ------------------------- |
| `type`            | `url`, `wifi`, `vcard`    | QR code type (required)   |
| `size`            | Number (pixels)           | Size of the QR code image |
| `errorCorrection` | `L`, `M`, `Q`, `H`        | Error correction level    |
| `align`           | `left`, `center`, `right` | Horizontal alignment      |

### Error correction levels

| Level          | Recovery | Best for                                  |
| -------------- | -------- | ----------------------------------------- |
| `L` (Low)      | \~7%     | Clean environments, maximum data capacity |
| `M` (Medium)   | \~15%    | Default, good balance                     |
| `Q` (Quartile) | \~25%    | Moderate damage tolerance                 |
| `H` (High)     | \~30%    | Printed materials that may get damaged    |

<Tip>
  If no `size` is specified, the QR code renders at a default size. For print documents, use `size=200` or larger for reliable scanning.
</Tip>
