Documentation
Feedback
Guides

Store Icons

All Store icons components.

Table of Contents

Concept

This project is based on SVG fragment identifiers. All store icons are served by Render SDK, and with HTML tag <use> we can render a fragment from our icon pack. If you want to know the complete list of fragment SVG's, see here

Usage

First of all, add into the dependencies of your manifest.tsxon and use it as an npm module:


_10
"dependencies": {
_10
"vtex.store-icons": "0.x"
_10
}

There are two different ways to use the icons available here. If you're developing a store's theme, you should use the icon block for the icon you want to render, which behaves just like any other block and expects to receive the props exposed by its API. But if you're developing custom components and want to use icons defined here, just follow the instructions below.

Dedicated Icon

Import the desired icon and use it into your code, for example:


_10
import { IconMenu } from "vtex.store-icons";
_10
_10
const YourComponent = (props) => <IconMenu />;

You can see here a list of every available icon.

Generic Icon

The API provides a generic icon, The Icon component. You can choose from any other icon passing only the id from the respective one you want to add.

For example:


_10
import { Icon } from "vtex.store-icons";
_10
_10
const YourComponent = (props) => <Icon id="hpa-cart" />;

⚠️ This component is meant to be used on icons there aren't common throughout the store. Choose dedicated components whenever possible.

Icons

Props

Any icon can receive the following props:

PropertyDescriptionTypeDefault value
idThe ID for the desired iconString''
sizeDesired sizeNumber16
isActivedescBooleantrue
activeClassNameThe className it should have if activeString🚫
mutedClassNameThe className it should have if not activeString🚫

Obs: ...props: It is important to notice that any other <svg> prop passed will work with an icon as well.

Enhanced Props

Some components support modifiers. These are props that define the icon type, orientation, state or shape.

ModifierPossible values
typefilled line outline
orientationup down left right
stateon off
shapesquare rounded circle

Icon List

Brand

ComponentidTypeOrientationStateShape
IconSocialsocial🚫🚫🚫square | rounded | circle

High Priority Actions

ComponentidTypeOrientationStateShape
IconArrowBackarrow-back🚫🚫🚫🚫
IconAssistantSalesassistant-sales🚫🚫🚫🚫
IconProfileprofile🚫🚫🚫🚫
IconCartcart🚫🚫🚫🚫
IconSearchsearch🚫🚫🚫🚫
IconDeletedelete🚫🚫🚫🚫
IconMenumenu🚫🚫🚫🚫
IconLocationMarkerlocation-marker🚫🚫🚫🚫

Medium Priority Actions

| Component | id | Type | Orientation | State | Shape | | ----------------------------------------------------------------------------------------------- | ------------- | ------------------------- | ----------- | --------- | ----- | ------ | | IconEyeSight | eyesight | filled | outline | 🚫 | on | off | 🚫 | | IconMinus | minus | filled | outline | line | 🚫 | 🚫 brands | | IconPlus | plus | filled | outline | line | 🚫 | 🚫 | 🚫 | brands | | IconSingleGrid | single-item | 🚫 | 🚫 | 🚫 | 🚫 | | IconRemove | remove | 🚫 | 🚫 | 🚫 | 🚫 | | IconSwap | swap | 🚫 | 🚫 | 🚫 | 🚫 | | IconHeart | heart | 🚫 | 🚫 | 🚫 | 🚫 | | IconGlobe | globe | 🚫 | 🚫 | 🚫 | 🚫 | | IconBookmark | bookmark | filled | outline | 🚫 | 🚫 | 🚫 | | IconPlay | play | filled | outline | 🚫 | 🚫 | 🚫 | | IconPause | pause | filled | outline | 🚫 | 🚫 | 🚫 |

Navigation

| Component | id | Type | Orientation | State | Shape | | ------------------------------------------------------------------------------------- | ------- | ---- | --------------------------- | ----- | ----- | ------------- | | IconCaret | caret | 🚫 | up | down | left | right | 🚫 | 🚫 | true | false |

Status Indicators

ComponentidTypeOrientationStateShape
IconCloseclosefilled | outline🚫🚫🚫
IconCheckcheckfilled | outline | line🚫🚫🚫
IconVolumeOnvolume-onfilled | outline | line🚫🚫🚫
IconVolumeOffvolume-offfilled | outline | line🚫🚫🚫

Customize

In the usage section, we discuss two ways of using icons. These ways extend to customization, so, prefer to change an existing Icon so that you can use the dedicated version. You can check how to override and name icons below.

Overwriting the default IconPack

As mentioned before, all icon IDs are stored at the iconpack.svg file. You can overwrite the default one by:

  1. On your store-theme create a new folder called iconpacks

  2. Create a file called iconpack.svg

  3. Declare your icon IDs (use the default iconpack as an example in how to do that properly).

Nomenclature

The naming convention is: intention-id--?modifiers

Where the modifiers follows the rule: ?type--?orientation--?state--?shape

🤓 ? stands for optional inputs

Icon Intention

bnd Brand - Display logos, brands or advertisements.

hpa High priority actions - Actions that are important to the global context.

mpa Mild priority actions - Actions that are important only to the current component context.

inf Informational - Represents information display or actions that, when triggered, reveal further details about the current context.

nav Navigation - Actions that triggers navigation.

sti Status indicators - Indicates the current item/component semantic status.

CSS Customization

In order to apply CSS customizations in this and other blocks, follow the instructions given in the recipe on Using CSS Handles for store customization.

CSS Handles
'arrowBackIcon'
'assistantSalesIcon'
'caretIcon'
'cartIcon'
'checkIcon'
'closeIcon'
'deleteIcon'
'equalsIcon'
'eyeSightIcon'
'filterIcon'
'globeIcon'
'gridIcon'
'heartIcon'
'homeIcon'
'inlineGridIcon'
'locationInputIcon'
'locationMarkerIcon'
'menuIcon'
'minusIcon'
'plusIcon'
'profileIcon'
'removeIcon'
'searchIcon'
'singleGridIcon'
'socialIcon'
'starIcon'
'swapIcon'
'playIcon'
'pauseIcon'
'fullscreenIcon'
'volumeOnIcon'
'volumeOffIcon'
Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page