Code Monkey home page Code Monkey logo

store-icons's Introduction

๐Ÿ“ข Use this project, contribute to it or open issues to help evolve it using Store Discussion.

All Contributors

Store Icons

Build Status

Store Icons are sets of icons tailored for store UI. The Store Icons are implemented using SVG fragment identifiers, which reference specific portions or elements within an SVG document. Leveraging SVG fragment identifiers makes it easier to link directly to and highlight particular sections or areas within the SVG document, facilitating navigation and interaction.

Render SDK serves all store icons, and with the HTML tag <use>, you can render a fragment from the icon pack. For more information on the complete list of fragment SVG's, access the Icon Pack List.

Table of Contents

Usage

Add into the dependencies of your manifest.json and use it as an npm module:

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

There are two ways for using the available icons:

  • Developing a store's theme: Use the icon block to render the desired icon. This block functions similarly to other blocks and anticipates the receipt of props as specified by its associated API.

  • Creating custom components: if you are creating custom components and wish to utilize the icons provided here, please follow the instructions below.

Dedicated Icon

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

import { IconMenu } from 'vtex.store-icons'

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:

import { Icon } from 'vtex.store-icons'

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:

Property Description Type Default value
id The ID for the desired icon String ''
size Desired size Number 16
isActive desc Boolean true
activeClassName The className it should have if active String ๐Ÿšซ
mutedClassName The className it should have if not active String ๐Ÿšซ

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.

Modifier Possible values
type filled line outline
orientation up down left right
state on off
shape square rounded circle

Icon List

Brand

Component id Type Orientation State Shape
IconSocial social ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ square | rounded | circle

High Priority Actions

Component id Type Orientation State Shape
IconArrowBack arrow-back ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconAssistantSales assistant-sales ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconProfile profile ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconCart cart ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconSearch search ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconDelete delete ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconMenu menu ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconLocationMarker location-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 ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconSingleItem single-item ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconList list ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconGallery gallery ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
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 ๐Ÿšซ ๐Ÿšซ

Status Indicators

Component id Type Orientation State Shape
IconClose close filled | outline ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconCheck check filled | outline | line ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconVolumeOn volume-on filled | outline | line ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
IconVolumeOff volume-off filled | 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 โœจ

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind are welcome!

store-icons's People

Contributors

analuizamttg avatar arthursampaio avatar brunoabreu avatar jgfidelis avatar kaisermann avatar klynger avatar klzns avatar lbebber avatar lucasecdb avatar mariana-caetano avatar matheusps avatar rerissondaniel avatar thalytafabrine avatar theomoura avatar victorhmp avatar vitorflg avatar vitoria avatar vtex-io-ci-cd[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

store-icons's Issues

Default Class

Is your feature request related to a problem? Please describe.
In some cases, I want to resize a custom icon in a specific size of screen, but custom icons do not contains a default class, this turns impossible to resize.

Describe the solution you'd like
Custom Icons can contains a default class like "Icon" or "svg"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.