Skip to main content
Once you’ve installed the package, you can generate a QR code in a single line. Choose the approach that best fits where you need it: a controller, a Blade template, or a terminal session.
The <x-qr-code> component is the simplest way to embed a QR code in a template. It handles SVG injection and accessibility attributes automatically.
Common options:
Generate a PNG embedded as a base64 data URI:
When format is svg, the component injects the SVG inline (including an accessible <title> and role="img"). When format is png or webp, it renders an <img> tag with a base64 src attribute — no file needs to be written to disk.
Pass extra HTML attributes directly:Any attributes not recognized as component props are forwarded to the rendered element:
Both <x-qr-code> and <x-qrcode> (no hyphen) are registered. Use whichever naming convention matches your project style.

Next steps

Blade Component

See every prop the <x-qr-code> component accepts, including gradient and eye-style customization.

Facade Reference

Explore the full QrCode facade API — colors, gradients, styles, image merging, and all fluent methods.

Data Types

Generate QR codes for WiFi, vCard, SMS, Email, WhatsApp, Telegram, BTC, Ethereum, and more.