# qrcode The **** component is used to generate and display a QR code. >![](../../public_sys-resources/icon-note.gif) **NOTE:** >This component is supported since API version 5. ## Permission List None ## Child Component Not supported ## Attribute In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.

Name

Type

Default Value

Mandatory

Description

value

string

-

Yes

Content used to generate the QR code

type

string

rect

No

QR code type. Available values are as follows:

  • rect: rectangular QR code
  • circle: round QR code
## Style In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.

Name

Type

Default Value

Mandatory

Description

color

<color>

#000000

No

QR code color

background-color

<color>

#ffffff

No

QR code background color

>![](../../public_sys-resources/icon-note.gif) **NOTE:** >- If the values of **width** and **height** are different, the smaller value is used as the length of the QR code. The generated QR code is center displayed. >- If either **width** or **height** is set, the value is used as the length of the QR code. If neither of them is set, the default length is 200 px. ## Event Events in [Universal Events](js-components-common-events.md) are supported. ## Method Methods in [Universal Methods](js-components-common-methods.md) are supported. ## Example ``` ```