title | description |
---|---|
QR Code |
Wrapper for qrcode. |
Wrapper for qrcode.
@install-pkg(qrcode)
<script>
import {qrcode} from "@sveu/extend/qrcode"
const {output, pending, error} = qrcode("Hello")
</script>
<script>
import { qrcode } from "@sveu/extend/qrcode" // [svp! hl:1]
let value = "world"
$: ({ output, pending, error } = qrcode(value)) // [svp! hl:1]
</script>
<div class="grid place-items-center">
{#if $pending}
<p>Pending.........</p>
{:else}
<img src="{$output}" alt="qrcode" />
<br />
{#if $error}
<p class="text-red-500">{$error}</p>
{/if}
<br />
{/if}
<input class="border border-4" bind:value="{value}" />
</div>
Name | Description | Type | Required |
---|---|---|---|
text | The text to encode | string |
Yes |
Read the qrcode documentation