This guide will help you understand how to transition an existing project from using the 2.x version of Kesko Design System’s icons to using the latest 3.0.0 version.

What’s changing? #

The size prop of the React components now uses the same scale as the icon size tokens, where md is the default 16px size. One icon is renamed to fix a typo, and the category slugs now match the category names. The release also adds new icons and redraws some of the existing ones. Import paths and the label and color props are unchanged.


Updating dependencies #

To migrate your application to use the latest Kesko Design System icons, update package.json with the necessary dependencies:

  • Update existing @kesko/iconography to version 3.0.0.

Here’s an example package.json:

{
  "dependencies": {
    "@kesko/iconography": "^3.0.0"
  }
}

Breaking changes #

Size scale #

We’ve renamed the size values so that they match the design tokens. If you’re passing any of these values to the size prop, you should search and replace them so that your icons keep their size after the update. Every pixel size keeps its value:

2.x3.0.0Size
"xs""md"16 px
"sm""lg"20 px
"md""xl"24 px
"lg""2xl"32 px
"xl""3xl"48 px

Replace from the largest step down, so that an already renamed "md" is not picked up again. Numbers and CSS strings such as size={40} need no change.

The default is still "md", which now means 16 px instead of 24 px. If you relied on the old default, add size="xl":

- <IconCart />
+ <IconCart size="xl" />

Renamed icon #

We’ve renamed one icon to fix a typo in its name. If you’re using it, you should search and replace the name so that it continues working after the update:

2.x3.0.0
cut-to-lenght-servicecut-to-length-service

The rename affects every way the icon can be referenced:

  // Individual React components: the component name and the file name change
- import IconCutToLenghtService from "@kesko/iconography/dist/react/IconCutToLenghtService.js";
+ import IconCutToLengthService from "@kesko/iconography/dist/react/IconCutToLengthService.js";

  // The Icon component: the name prop changes
- <Icon name="cut-to-lenght-service" />
+ <Icon name="cut-to-length-service" />

  // ES modules and raw SVG files: the file name changes
- import svg from "@kesko/iconography/dist/assets/cut-to-lenght-service.js";
+ import svg from "@kesko/iconography/dist/assets/cut-to-length-service.js";

Category slugs #

Category slugs now match the category names. This only affects code that reads icon metadata. If you never read category from dist/icons.json or dist/icons.js, and don’t use the KeskoIconCategory type, there is nothing you need to change:

2.x3.0.0
filterslists-and-filters
alertsnotifications-and-alerts
securitypasswords-and-safety
locationlocation-and-navigation
contactcontact-and-feedback
shoppingshops-and-shopping
deliverypick-up-and-delivery
seasonsseasons-and-campaigns
financefinance-and-contracts
loyaltyloyalty-programs
hardwarehardware-and-renovation
homehome-and-garden
servicesshopping-categories-and-services
sustainabilityenvironment-and-sustainability
electronicselectronics-and-telecom

Eight icons have also moved to another category, so a filter built on one of these categories returns a slightly different set of icons:

Icon2.x3.0.0
healthy-facilityHome and gardenShopping categories and services
parkingShopping categories and servicesAutomotive
priceShopping categories and servicesFinance and contracts
robotPick-up and deliveryElectronics and telecom
servicesShopping categories and servicesShops and shopping
sleepShopping categories and servicesEnvironment and sustainability
stampFinance and contractsLoyalty programs
wallpapersHardware and renovationHome and garden

New icons #

The following icons are new in 3.0.0. You can browse them, and the rest of the library, on the icons page:

  • butter (groceries)
  • double-chevron-left (arrows)
  • double-chevron-right (arrows)
  • egg (groceries)
  • hand-pointer (basic-ui)
  • keyboard (electronics-and-telecom)
  • list-reset (lists-and-filters)
  • moon (environment-and-sustainability)
  • nuts-seeds (groceries)
  • order-pickup-ready (pick-up-and-delivery)
  • order-processing (pick-up-and-delivery)
  • order-received (pick-up-and-delivery)
  • order-sent (pick-up-and-delivery)
  • peas (groceries)
  • pin-code (pick-up-and-delivery)
  • view-blocks (lists-and-filters)

Updated icons #

The following icons have been redrawn. Their names are unchanged, so there is nothing you need to update, but it’s worth checking how they look in your product:

  • exclamation-mark, info-mark, question-mark, share and tick are drawn larger, so that they fill the 24×24 grid.
  • alcohol and alcohol-free no longer include the percent badge.
  • age-restricted now reads K18 instead of K-18.
  • egg-free now shows the yolk.
  • easter has a closed outline.

Getting support #

Have a question about migration to 3.0.0? Please head over to the Support page for more guidelines and ways to contact us.