Keyfob.QR (Keyfob v0.1.0)

Copy Markdown View Source

Renders a string as an inline SVG QR code via eqrcode.

Inline SVG means no <img> round-trip and no JS — the QR is part of the LiveView diff, so rotating it (new token) is a normal re-render.

Summary

Functions

Returns an SVG string encoding data.

Functions

svg(data, opts \\ [])

@spec svg(
  String.t(),
  keyword()
) :: String.t()

Returns an SVG string encoding data.

Options:

  • :size — the SVG's pixel width/height (default 240)
  • :background — background color (default "#ffffff")
  • :color — module color (default "#000000")

The SVG carries role="img" and the given :title (default "QR code") for accessibility.