pablohirafuji/elm-qrcode/1.1.0

NOTE: this package is not compatible with Elm 0.19.1

QRCode

QR Code encoder and renderer.

Rendering

toSvg : String -> Result Error (Html msg)

Transform a string into a result Error or a QR Code svg element using ECLevel.Q (25% of codewords can be restored).

qrCode : Html msg
qrCode =
    let
        resultQRCode = toSvg "Hello world"

    in
        case resultQRCode of
            Result.Ok view -> view
            Result.Err err -> Html.text (toString err)

Tip: You can determine the size of the generated svg setting width and height styles.

toSvgWithECLevel : String -> ECLevel -> Result Error (Html msg)

Transform a string with a given EClevel into a result Error or a QR Code svg element.