NC QR Code

Not yet released: this component will ship in an upcoming Native Rent package version.

NC QR Code shows a QR code or a Code 128 barcode for a text, such as a record Id, a URL, or a Rentable code. The code is drawn in the browser as a sharp SVG. It works offline and calls no external service. An optional caption can appear under the code, and an optional Download button can save a PNG on desktop.

Use it for a QR label on a Rentable that staff can scan later.

NC QR Code on desktop: a QR code, the caption Account tag, and the Download button.
NC QR Code on desktop: a QR code, the caption Account tag, and the Download button.
NC QR Code, Code 128 on desktop: a barcode with the caption NC-KIT-TEST-RENTABLE-001, an optional empty value that shows nothing, and the invalid message.
NC QR Code, Code 128 on desktop: a barcode with the caption NC-KIT-TEST-RENTABLE-001, an optional empty value that shows nothing, and the invalid message.

Code types

Code Type is qr (the default) or code128.

The code is always black on white, with a quiet zone. Theme colors do not apply to the code, so it stays readable in light and dark themes.

QR:

Code 128:

Size: Code Size is the QR code's width and height (96 to 512 px, default 200). For Code 128 it is the minimum width. The code is never wider than the screen.

Caption is optional text under the code. The caption shows exactly as given.

Download: With Show Download Button on, a Download button saves the code as a PNG, with whole pixels per module so it prints sharply. The button shows on desktop only. It is hidden on phones and tablets, and when the browser window or the code area is 600 px wide or less, for example a narrow or zoomed-in desktop window. The file name is Download File Name, or qr-code.png or barcode.png if that is blank.

Alignment is start, center (the default), or end.

NC QR Code has no layout, navigation, or accent color settings. It only shows a code.

The image has an accessible name: "QR code: " plus the value, or "Barcode: " plus the value.

Add it to a screen

  1. Add NC QR Code to the screen. Set Value to Encode to a record Id, or a text field such as a serial or asset number.
  2. Set Code Type to QR or Code 128. For a QR code, set Error Correction if you need more than the default M.
  3. Optionally set Caption, Code Size, and Alignment.
  4. Turn on Show Download Button if staff should save a PNG on desktop. Optionally set Download File Name.
  5. Turn on Required if Next should wait until there is a code to show.

Example

A QR label for a Rentable:

Validation

A value that cannot be encoded shows "This text is too long for a QR code." or "This text can't be shown as a Code 128 barcode. Use letters, digits and common symbols, up to 80 characters." under the component. These messages block Next only when Required is on.

An empty value that is not required shows nothing and does not block Next. "There is no value to show as a code." appears only when Required is on, when the user taps Next. You can replace that text with Required Message. The message shows under the component, not as a Flow error.

A required NC QR Code with an empty value after Next: "There is no value to show as a code."
A required NC QR Code with an empty value after Next: "There is no value to show as a code."

Phone and desktop

The code shrinks so it is never wider than the screen. The Download button shows on desktop only. It is hidden on phones and tablets, and when the browser window or the code area is 600 px wide or less. The button is at least 44 px tall. NC QR Code has no Layout Auto, no Navigate After Selection, and no Color Map or accent color.

Limits

Properties

PropertyAPI nameDefaultDescription
LabelfieldLabel(blank)Optional label shown above the code.
Help TexthelpText(blank)Optional hint under the label.
Value to Encodevalue(blank)The text in the code, e.g. a record Id, or a text field such as a serial or asset number. QR: up to about 2,300 characters at level M. Code 128: letters, digits and common symbols (printable ASCII), up to 80 characters.
Code TypecodeTypeqrqr (default) or code128 (a 1D barcode).
Error CorrectionerrorCorrectionMQR only: L (7%), M (15%, default), Q (25%) or H (30%). Higher levels survive more damage but make a denser code.
Code Size (px)codeSize200QR: width and height in pixels (96-512, default 200). Code 128: minimum width; the barcode is at least 2px per bar. Never wider than the screen.
Captioncaption(blank)Optional text under the code, e.g. the asset name or the value itself.
Show Download ButtonshowDownloadfalseShow a Download button (PNG). Desktop only; hidden on phones, tablets, and when the code area or browser window is 600px wide or less.
Download File NamedownloadFileName(blank)Optional. Blank uses qr-code.png or barcode.png.
Alignmentaligncenterstart, center (default) or end.
RequiredrequiredfalseBlock Next while there is no code to show (Value to Encode is empty or can't be encoded).
Required MessagerequiredMessage(blank)Optional. Blank uses the translated default.

NC QR Code has no outputs. Value to Encode is an input only.

Third-party code

NC QR Code draws codes in the browser. It uses two MIT-licensed parts that ship in the kit. Neither one calls an external service.

Shared behavior

Layout and width, required messages, colors, navigation, data sources, translations, accessibility, and the setup panel work the same way on every component. See NC screen components.

To copy this component's settings to another screen, use Copy settings at the top of its setup panel. See Copy settings.