# Config the desktop gadget

Feishu gadgets can run on both mobile and desktop. According to the actual situation, you can choose to directly use the code of the gadget on the mobile to run on the desktop, or you can develop an independent gadget for your application on the desktop. The gadget on the desktop supports small window and large window modes, and supports multiple opening methods, which is convenient for you to develop gadgets suitable for large screens on the desktop. This article introduces the window mode and opening method of the desktop gadget, as well as the code package type of the desktop gadget.

## The running mode of the desktop gadget

### Small window mode

When the gadget is running on the desktop, it supports the small window mode by default. The effect of this mode is closer to that of the mobile terminal, and the example effect is shown in the figure below.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/dff221fc59d421f200c6d9c0f325e561_oTeliefXFV.png?height=1242&lazyload=true&maxWidth=600&width=1824)

### Large window mode

The gadget provides [ext global configuration items](https://open.feishu.cn/document/uYjL24iN/uEDNuEDNuEDN#8959728c). You can set the ext > defaultPages > PCMode parameter in the app.json file in the root directory of the gadget project to specify the default startup page for the large window mode.
```
{
   "pages": [
     "pages/index/index",
     "pages/logs/index",
     "pages/order/inde",
     "pages/chat/index"
   ],
   "ext": {
     "defaultPages": {
       "sidebarMode": "pages/component/index",//The default startup page when starting the gadget in small window mode
       "PCMode": "pages/PC/component/index"//The default startup page when the gadget is started in large window mode
     }
   }
}
```
When the configuration takes effect, the large window mode will be used when opening the gadget on the desktop.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/fd8e1ae39df7354a44b774af1f8761ab_JQbmTKZclt.png?height=1008&lazyload=true&maxWidth=600&width=1514)

- After enabling the large window mode of the gadget, when the gadget is opened in the workbench of the Feishu desktop, the large window mode will be used by default.

- After enabling the large window mode of the gadget, if your gadget application also enables the robot and web app capabilities, the entry of **Open Application** will be displayed in the corresponding application card of the Feishu client. If there is no large window mode (PCMode) page configured, or the configuration is not effective, the **Open Application** entry will not be displayed.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/b3881de6f8003b3d90990418caf8be49_LOHrTD5cjx.png?height=1232&lazyload=true&maxWidth=600&width=2062)

### Applink to open the gadget

In addition to directly opening the desktop gadget through the small window and large window mode, you can also open the gadget through [Applink](https://open.feishu.cn/document/uYjL24iN/ucjN1UjL3YTN14yN2UTN). This method can add `mode` parameter in the Applink link to control the opening method of the gadget.
- The value range of the `mode` parameter in the small window mode

Mode parameter value | Scene description | Effect example
---|---|---
mode=sidebar-semi | Opens the gadget as a sidebar when the IM chat page starts. | ![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/84300b12bcb1703495af2d8ee3d13c23_G0CJ7n8YbX.png?height=1224&lazyload=true&width=1820)
mode=sidebar-semi | When the gadget is started in a scene other than the IM chat page, it will be opened in the form of an independent small window. | ![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/5a4700ee32ad765a17f97809ebd1b30a_aLik7ifHFB.png?height=1218&lazyload=true&width=2068)
mode=window-semi | Open the gadget as a small independent window. | ![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/44799e1b582e509bdfd3e52a8f291c26_tCSDzCIJ7u.png?height=1226&lazyload=true&width=1810)

- Value range of `mode` parameter in large window mode

Mode parameter value | Scene description | Effect example
---|---|---
mode=appCenter | Open the gadget as a workbench tab. | ![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/e08b3c735fe3d0243727143131565fb3_J4s1waz1rb.png?height=1160&lazyload=true&width=1752)
mode=window | Opens the gadget in a separate large window. | ![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/52793dfa92197b9603430ddaca1d45af_w3iN0oNgBW.png?height=1080&lazyload=true&width=1704)

## Desktop gadget code package

After you use [Feishu Developer Tool](https://open.feishu.cn/document/uYjL24iN/ucDOzYjL3gzM24yN4MjN) to develop and upload the gadget, the corresponding gadget in [Developer Consle](https://open.feishu.cn/app) In the application, it is necessary to complete the configuration of the corresponding mobile and desktop gadgets. When configuring the desktop gadget, you need to select the gadget code package first.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/25d5c4e73b902277eecef5d886c2c7e5_e2wgxh5LPw.png?height=978&lazyload=true&maxWidth=600&width=1690)

The available code packages for desktop gadgets include mobile gadget packages and independent gadget packages.

- Mobile gadget package: If you want to maintain both mobile and desktop gadgets in the same project, you can upload only one mobile gadget to the application in the developer’s background after completing the gadget development. And in the gadget configuration of the application, choose to use the mobile gadget code package for the desktop.

- Independent gadget package: If you want to maintain the mobile gadget and the desktop gadget independently, you can upload each gadget to the application in the developer's background, and select Use standalone gadget packages.

There is no difference in the final use of the desktop gadgets implemented by the above two types of gadget packages. You can choose the adaptation method according to the habits of the R&D team in the gadget development stage.

### Use the mobile gadget package

The open platform allows the desktop gadget to use the mobile gadget package by default. When you configure **Use the mobile gadget package** for the desktop in the gadget application, no other separate configuration is required. You only need to Just complete the functional test of the gadget.

After using this code package, the desktop gadget will be opened according to the mode parameter set in [Operation Mode](https://open.feishu.cn/document/uYjL24iN/uIjNzUjLyYzM14iM2MTN#37991f21).

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/87d20b28a8defdfca3fd16f4000ecb85_z8TiB8T5PK.png?height=460&lazyload=true&width=1698)

### Do not use the mobile gadget package

When you upload only the mobile gadget in the Feishu developer tool, you can select **Do not use the mobile gadget package** in the gadget application in the developer background. After selecting this type, when using Applink on the desktop to open the gadget, a QR code will be used to guide the user to use the Feishu mobile terminal to scan the code to open the application.

- The icon of the Feishu developer tool to upload the mobile gadget is as follows.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/a761b9d81180672b1a8584e9c124d7a0_iWqmetnHL7.png?height=1586&lazyload=true&maxWidth=600&width=2858)

- In the gadget application in the developer background, the gadget configuration icon is as follows.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/c356aae2bcdbbd507379e9f17c78bc1b_8yAipuZIZX.png?height=906&lazyload=true&maxWidth=600&width=1658)

- When opening the gadget on the desktop, an example of the QR code that appears is shown in the figure below.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/8774582510e8c48c54529650f2bc0f06_PKwE4wVfHK.png?height=1016&lazyload=true&maxWidth=600&width=2666)

### Use desktop stand-alone gadget package

If you want to independently maintain the mobile and desktop gadget codes, you can upload the mobile and desktop gadgets separately when uploading gadgets in the Feishu Developer Tools. After you upload the desktop gadget, you can choose **Use an independent gadget package** in the gadget application in the developer background.

- The icon of the desktop gadget uploaded by Feishu Developer Tools is as follows.
Uploading the PC side in the Feishu developer tool can prevent the PCMode parameter configuration of the desktop gadget from not taking effect.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/3344424ac7504d335a64eb6c97e30088_JJeqcii9XO.png?height=1322&lazyload=true&maxWidth=600&width=1864)

- In the gadget application in the developer background, the gadget configuration icon is as follows.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/6fe4c1e5a1bf1336bda9d18e0cabce78_e0yCkCiTbU.png?height=954&lazyload=true&maxWidth=600&width=1682)