On this page
@addTagHelper *, Webority.Ui.RazorAuthenticator setup
Give the code a title that says what scanning does, because a screen reader announces it in place of the picture.
Long values
A long signed token still fits in a code, but the code gets denser, so give it more room.
Copy fallback
Put the same value beside the code, so a person who cannot scan can still copy it.
Every option
Every value of every prop, one cell each.
value
a URLan otpauth URIa 1,500-character tokensize
size="120"
size="180"
(default) size="240"
size="320"
title
(default) title="QR code"title="Scan to open the site"className
class="border"Guidance
What to do, and what to avoid.
Use it when
- Someone needs to move a link or a code from a screen to a phone.
- An authenticator app needs a setup key.
- A printed or on-screen document carries a value a scanner verifies.
Reach for something else when
- The person is already on a phone. → AppLink
- The value is a short code people type. → AppCopyButton
Clear title and room to scan
Enough room around it, and a title that says what scanning does.
A long value squeezed into a small box. The squares are too small to scan, and part of the code is cut off.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
3 props. The 3 most used come first.
Used on most screens 3 props
| Prop | Type | Default | Description |
|---|---|---|---|
| valuedefault - | string | - | The text to encode, such as a link, an otpauth setup address or a signed token. Nothing renders while it is empty. |
| sizedefault 240 | int | 240 | The largest width and height in px. The code draws at the biggest whole number of pixels per module that fits. |
| titledefault QR code | string | QR code | The accessible name. Say what scanning it does. |
Screen reader
3 notes- The code is an image named by title, so the title should say what scanning it does.
- Nothing is drawn while value is empty, so no unnamed image reaches assistive technology.
- The code is always black on white, whatever the theme, because scanners need that contrast.
Do and avoid
1 pairsClear title and room to scan
Enough room around it, and a title that says what scanning does.
A long value squeezed into a small box. The squares are too small to scan, and part of the code is cut off.