Change an icon and add a badge
You can easily customize widgets on the by changing their icons and adding additional components such as badges to the widgets. In this section, you learn to change the calendar icon and add a badge using an expression on the calendar to show the number of calendar events for the week.
- Open the Hello- solution in in , click on the calendar.jigx file.
- Replace icon: calendar-3 with icon: calendar.
- Under icon add a new line for the badge code that shows the number of calendar events for the week. Add badge: Then use the =$count(@ctx.datasources.calendar-data.id) expression to count the events in the calendar and show the number in the badge on the .
4. Save and publish the Hello- solution. 5. Run the Hello- solution on your mobile device to see the change to the calendar icon and see the badge displaying 3 events for the week on the .