Issues when customizing FastStore icons
Troubleshoot common issues when adding custom icons or overriding native icons in a FastStore project.
FastStore users may encounter issues when customizing the icon set in their store, either by adding a custom icon or overriding a native icon. The icon may not appear, look distorted, or ignore the theme colors. In some cases, the default FastStore icons may stop rendering after the change.
| Issue | Possible cause | Solution |
|---|---|---|
| The icon doesn't appear, or the override has no effect in the storefront. | The id doesn't match the name prop, or icons.svg isn't in the right location. | Verify the icon configuration |
| The icon renders, but looks distorted or the size is inconsistent. | The viewBox is missing, the markup is incompatible, or there are hardcoded dimensions. | Fix the SVG markup |
| The icon ignores the theme and renders in a fixed color. | The paths use hardcoded fill or stroke values instead of currentColor. | Make the icon respect the theme |
| Default FastStore icons stopped rendering after the customization. | The custom icons.svg replaced the default file without including the original symbols. | Restore the default icons |
Solutions
To solve your issue, follow one of the paths below based on the symptom you're seeing.
Verify the icon configuration
Use this path when the icon doesn't appear at all or when an override has no effect.
- Open
/public/icons.svgand confirm that theidon the<symbol>element exactly matches thenameprop passed to theIconcomponent, including capitalization. For overrides, theidmust remain identical to the original icon'sid. - Make sure
icons.svgis at the root of/public/, not inside a subfolder. - Run
yarn dev(oryarn build) to copy the file into the build output. - Clear your browser cache and reload the local store to confirm the icon now appears.
Fix the SVG markup
Use this path when the icon renders but looks broken, distorted, or inconsistently sized.
- Open the
<symbol>for your icon in/public/icons.svg. - Confirm the
viewBoxattribute is set and matches the original artwork dimensions (for example,viewBox="0 0 256 256"). For overrides, use the sameviewBoxas the original symbol to keep consistent sizing across components. - Remove hardcoded
widthandheightattributes from the<symbol>so the icon can be scaled by theIconcomponent. - Check that the SVG paths are valid and self-contained, with no references to external files or
<defs>outside the symbol. - Remove transforms, clip paths, or masks that depend on context outside the original SVG.
- Save the file, rebuild the project, and check the icon in the storefront.
Make the icon respect the theme
Use this path when the icon appears in a fixed color and ignores the surrounding text color or theme.
- Open the
<symbol>for your icon in/public/icons.svg. - Replace hardcoded
fillandstrokeattribute values withcurrentColorso the icon inherits the surrounding text color. - Remove any inline
styleorcolorattributes that pin the icon to a specific color. - Save the file, rebuild the project, and verify the icon now reflects the theme.
Restore the default icons
Use this path when default FastStore icons stop rendering after you add a custom icon or apply an override.
- Open your terminal and run
yarn devto make sure the.faststorefolder is up to date. - Copy
.faststore/public/icons.svgagain into your store's/public/folder, overwriting the current file. - Reapply your customizations to the new copy:
- For custom icons, add your new
<symbol>entries following the Adding custom icons guide. - For overrides, replace the contents of the relevant
<symbol>entries following the Overriding native icons guide.
- For custom icons, add your new
- Rebuild the project and confirm the default and custom icons are both visible.
If the issue continues after following these steps, open a ticket with VTEX Support.