1 | # @shopify/polaris-icons
|
2 |
|
3 | [![npm version](https://img.shields.io/npm/v/@shopify/polaris-icons.svg?style=flat)](https://www.npmjs.com/package/@shopify/polaris-icons)
|
4 |
|
5 | > This package exports a JavaScript file containing the Polaris icons that can be used by partners building on the Shopify platform, and contains SVG files in the [`/images/` directory](https://unpkg.com/@shopify/polaris-icons/images/).
|
6 |
|
7 | Browse and search Polaris icons: <https://polaris-icons.shopify.com>.
|
8 |
|
9 | ## Getting started
|
10 |
|
11 | Although it's possible to use this package directly, we recommend using the icons in this package through [Polaris React](https://github.com/Shopify/polaris-react) in combination with the `Icon` component from that project. Make sure that your app is using Polaris React version 3.10.0 or higher.
|
12 |
|
13 | ## Installation
|
14 |
|
15 | After you have Polaris React installed, you need to add Polaris icons as a dependency.
|
16 |
|
17 | Run the following command using [npm](https://www.npmjs.com/):
|
18 |
|
19 | ```
|
20 | npm install @shopify/polaris-icons --save
|
21 | ```
|
22 |
|
23 | If you prefer [Yarn](https://yarnpkg.com/en/), then use the following command instead:
|
24 |
|
25 | ```
|
26 | yarn add @shopify/polaris-icons
|
27 | ```
|
28 |
|
29 | ## Usage
|
30 |
|
31 | Import the `Icon` component from Polaris React and any icon from Polaris icons into your project.
|
32 |
|
33 | 1. Include the icon component from Polaris React:
|
34 |
|
35 | ```tsx
|
36 | import {Icon} from '@shopify/polaris';
|
37 | ```
|
38 |
|
39 | 2. Include an icon from Polaris icons:
|
40 |
|
41 | ```tsx
|
42 | import {AddMajorMonotone} from '@shopify/polaris-icons';
|
43 | ```
|
44 |
|
45 | 3. Pass the imported Polaris icon to the `source` prop of the `Icon` component:
|
46 |
|
47 | ```tsx
|
48 | <Icon source={AddMajorMonotone} />
|
49 | ```
|
50 |
|
51 | ### SVG files
|
52 |
|
53 | For consumers who donβt use React, we provide SVG files within the `images` folder.
|
54 |
|
55 | View the list of available files on [unpkg](https://unpkg.com/@shopify/polaris-icons/images/).
|
56 |
|
57 | ## Contributing π
|
58 |
|
59 | Make changes to this package to add, remove, or rename publicly available icons. See our [contributing guide](https://github.com/Shopify/polaris-icons/blob/master/CONTRIBUTING.md). π
|
60 |
|
61 | ## Licenses π
|
62 |
|
63 | - Source code is under a [custom license](https://github.com/Shopify/polaris-icons/blob/master/LICENSE.md) 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.
|
64 | - All icons and images are licensed under the [Polaris Design Guidelines License Agreement](https://polaris.shopify.com/legal/license).
|
65 |
|
\ | No newline at end of file |