Qrcode Generator - QRCodeGeneratorComponent

18 Nov 20263 minutes to read

Represents react QRCode Component

<QRCodeGeneratorComponent></QRCodeGeneratorComponent>

Properties

backgroundColor string

Defines the background color of the QR code.

Defaults to ‘white’

displayText DisplayTextModel

Defines the text properties for the QR code.

Defaults to ’’

enableGS1 boolean

Specifies whether the value is encoded as a GS1 QR Code. When true, the value is
GS1 data, bracketed or raw; it is validated and encoded with FNC1.

Defaults to false

enablePersistence boolean

Enable or disable persisting component’s state between page reloads.

Defaults to false

enableRtl boolean

Enable or disable rendering component in right to left direction.

Defaults to false

enableWebMcp boolean

Specifies whether the WebMCP integration is enabled in the component.
When set to true, the component provides a set of tools with schemas and execute functions
that allow AI models to perform actions within the component context.

Defaults to false

errorCorrectionLevel ErrorCorrectionLevel

Defines the error correction level of the QR code.

Defaults to undefined

foreColor string

Defines the forecolor of the QR code.

Defaults to ‘black’

height string|number

Defines the height of the QR code model.

Defaults to ‘100%’

locale string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

Defaults to ’’

Specifies the logo overlay configuration for the QR code.

Defaults to ’’

margin MarginModel

Defines the margin properties for the QR code.

Defaults to ’’

mode RenderingMode

Defines the QR code rendering mode.

  • SVG - Renders the bar-code objects as SVG elements
  • Canvas - Renders the bar-code in a canvas

Defaults to ‘SVG’

value string

Defines the type of barcode to be rendered.

Defaults to undefined

version QRCodeVersion

  • Defines the version of the QR code.

Defaults to undefined

webMcpSettings WebMcpBarcodeSettingsModel

Configures WebMCP tool registration and exposure settings.
When set, tools are automatically registered with the provided configuration.

Defaults to undefined

width string|number

Defines the width of the QR code model.

Defaults to ‘100%’

xDimension number

Defines the xDimension of the QR code model.

Methods

destroy

It is used to destroy the Barcode component.

Returns void

exportAsBase64Image

Export the barcode as an image in the specified image type and returns it as base64 string.

Parameter Type Description
barcodeExportType BarcodeExportType Defines the format of the barcode to be exported

Returns Promise

exportImage

Export the barcode as an image in the specified image type and downloads it in the browser.

Parameter Type Description
filename string Specifies the filename of the barcode image to be download.
barcodeExportType BarcodeExportType Defines the format of the barcode to be exported

Returns void

getModuleName

Returns the module name of the barcode

Returns string

getPersistData

Get the properties to be maintained in the persisted state.

Returns string

getWebMcpTools

Returns the WebMCP tool schemas for the given tool names.
When toolNames is omitted, schemas for all available tools are returned.

Parameter Type Description
toolNames (optional) string[] Optional: filter tool names. Omit to get all tools.

Returns WebMcpTool[]

registerWebMcpTools

Registers WebMCP tools on document.modelContext for this component instance.

Returns void

Events

beforeWebMcpToolExecute EmitType<WebMcpToolExecuteEventArgs>

Triggers before a WebMCP tool execution begins.
Set args.cancel to true to prevent the tool from running, or args.showConfirmationDialog
to ask the user for confirmation first.

invalid EmitType<Object>

Triggers if you enter any invalid character.