@itravelholidays/polaris-icons
v7.8.3
Published
[](https://www.npmjs.com/package/@itravelholidays/polaris-icons)
Readme
@itravelholidays/polaris-icons
This package exports a JavaScript file containing the Polaris icons for building on the iTravelHolidays platform, and contains SVG files in the
/dist/svgdirectory.
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.
Installation
Install Polaris React if you haven't already
Install Polaris icons as a dependency:
npm:
npm install @itravelholidays/polaris-icons --saveyarn:
yarn add @itravelholidays/polaris-icons
Usage
Import the Icon component from Polaris React and any icon from Polaris icons into your project.
Import the icon component from Polaris React:
import {Icon} from '@itravelholidays/polaris';Import an icon from Polaris icons:
import {AddMajor} from '@itravelholidays/polaris-icons';Use the icon in your 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.
Suggested CSS and markup for projects that aren't using the Polaris HTML and CSS components:
<style>
.polaris-icon {
display: block;
height: 2rem;
width: 2rem;
max-height: 100%;
max-width: 100%;
margin: auto;
}
</style>
<span class="polaris-icon">
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<!-- SVG content here -->
</svg>
</span>Contributing 🙌
To add, remove, or rename icons, follow the contributing guide.
Licenses 📝
- Source code is under a custom license based on MIT.
