To test your card code and see a preview of the card, use DivKit Playground: an editor in the browser and apps for Android, iOS, and Flutter.
Web
To test your code and view HTML card previews, use DivKit Web Playground. DivKit Web Playground has a library with samples of various elements: you can edit the code of any sample and display the result in the browser or on the screen of a mobile device.
To create an HTML card preview:
On the left side of the page, add the card prototype code in JSON or TypeScript format.
To use ready-made samples, click Samples and select an item from the library. You can edit and refine the samples.
On the right side of the page, select the resolution and type of screen for which the card prototype will be displayed. If there are errors in the code, they will be displayed in the Errors section under the card preview.
To open the card structure, click Structure in the lower right corner.
View the result on your device
To view the result of a JSON change in an Android or iOS app, link the editor to it:
Install the DivKit Playground app for Android or iOS on your device.
Select demo in the Android app or playground in the iOS app.
In DivKit Web Playground, click Share.
Scan the QR code in the app or paste the address from the Link to json field. In the Android app, the scanner is opened with the button; in the iOS app, it is enabled in settings.
Android
To test your code and see a preview of the card on an Android device, use the DivKit Playground app. You can add the card code in JSON format to the app or open a link to it:
To test your code and see a preview of the card on an iOS device, use the DivKit Playground app. The app opens a card by a link to its description in JSON format:
Download the DivKit Playground source files from the repository, compile and install the app on the device.
Select playground.
Add a card using one of the following methods:
Insert a link to the card prototype in the input field.
Open the link from the DivKit Web Playground editor or scan its QR code. The QR scanner is enabled in settings.
To test your code and see a preview of the card on an Android or iOS device, use the DivKit Playground app. You can add the card code in JSON format to the app or open a link to it: