@shopify/polaris-icons
[![npm version](https://img.shields.io/npm/v/@shopify/polaris-icons.svg?style=flat)](https://www.npmjs.com/package/@shopify/polaris-icons)
$ cnpm install @shopify/polaris-icons 
SYNC missed versions from official npm registry.

@shopify/polaris-icons

npm version

This package exports a JavaScript file containing the Polaris icons partners can use to build on the Shopify platform, and contains SVG files in the /dist/svg directory (SVG usage instructions).

Browse and search Polaris icons: https://polaris-icons.shopify.com.

Getting started

Although it’s possible to use this package directly, we recommend using the icons in this package through Polaris React in combination with the Icon component. Make sure that your app is using Polaris React version 3.10.0 or higher.

Installation

  1. Install Polaris React (instructions) if you haven’t already

  2. Polaris icons as a dependency:

    Using npm:

    npm install @shopify/polaris-icons --save
    

    Or, using Yarn:

    yarn add @shopify/polaris-icons
    

Usage

Import the Icon component from Polaris React and any icon from Polaris icons into your project.

  1. Import the icon component from Polaris React:

    import {Icon} from '@shopify/polaris';
    
  2. Import an icon from Polaris icons:

    import {AddMajor} from '@shopify/polaris-icons';
    
  3. Pass the imported Polaris icon to the source prop of the Icon component:

    <Icon source={AddMajor} />
    

SVG files

For projects that don’t use React, icons are also available as *.svg files in the dist/svg folder.

Browse the list of SVG files, hosted on the unpkg CDN (Content Delivery Network).

Suggested CSS and markup for projects that aren’t using the Polaris HTML and CSS components:

.Custom-Polaris-Icon {
  display: block;
  height: 2rem; /* or value equivalent to 20px */
  width: 2rem; /* or value equivalent to 20px */
  max-height: 100%;
  max-width: 100%;
  margin: auto;
}

.Custom-Polaris-Icon__Svg {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;

  /* Icon color */
  fill: #000;
}
<span class="Custom-Polaris-Icon">
  <svg
    viewBox="0 0 20 20"
    class="Custom-Polaris-Icon__Svg"
    focusable="false"
    aria-hidden="true"
  >
    <path fill="currentColor" d="M7 13h6v6H7z" />
    <path
      d="M19.664 8.252l-9-8a1 1 0 0 0-1.328 0L8 1.44V1a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v5.773L.336 8.252a1.001 1.001 0 0 0 1.328 1.496L2 9.449V19a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V9.449l.336.299a.997.997 0 0 0 1.411-.083 1.001 1.001 0 0 0-.083-1.413zM16 18h-2v-5a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v5H4V7.671l6-5.333 6 5.333V18zm-8 0v-4h4v4H8zM4 2h2v1.218L4 4.996V2z"
      fill-rule="evenodd"
    />
  </svg>
</span>

Contributing ????

To add, remove, or rename icons, follow the contributing guide (restricted to Shopify employees). ????

Licenses ????

  • Source code is under a custom license based on MIT. The license restricts Polaris icons usage to applications that integrate or interoperate with Shopify software or services, with additional restrictions for external, stand-alone applications.
  • All icons and images are licensed under the Polaris Design Guidelines License Agreement.

Current Tags

  • 4.1.0                                ...           latest (3 days ago)
  • 3.0.0-beta.6                                ...           next (2 years ago)

36 Versions

  • 4.1.0                                ...           3 days ago
  • 4.0.0                                ...           a month ago
  • 4.0.0-rc.4                                ...           a month ago
  • 4.0.0-rc.3                                ...           a month ago
  • 4.0.0-rc.2                                ...           a month ago
  • 4.0.0-rc.1                                ...           a month ago
  • 4.0.0-alpha.2                                ...           a month ago
  • 3.12.0                                ...           3 months ago
  • 3.11.0                                ...           3 months ago
  • 3.10.0                                ...           7 months ago
  • 3.9.0                                ...           10 months ago
  • 3.9.0-alphasideeffectsonly.0                                ...           10 months ago
  • 3.9.0-alpha.1                                ...           10 months ago
  • 3.9.0-alpha.0                                ...           10 months ago
  • 3.8.0                                ...           a year ago
  • 3.7.0                                ...           a year ago
  • 3.6.0                                ...           a year ago
  • 3.5.1                                ...           a year ago
  • 3.5.0                                ...           a year ago
  • 3.4.0                                ...           a year ago
  • 3.2.1-test-gem-branch.1                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 3.0.0-beta.6                                ...           2 years ago
  • 3.0.0-beta.5                                ...           2 years ago
  • 3.0.0-beta.3                                ...           2 years ago
  • 3.0.0-beta.2                                ...           2 years ago
  • 3.0.0-beta.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 1.0.0-beta.5                                ...           2 years ago
  • 1.0.0-beta.4                                ...           2 years ago
  • 1.0.0-beta.3                                ...           2 years ago
  • 1.0.0-beta.2                                ...           2 years ago

Copyright 2014 - 2017 © taobao.org |