uni-builder-icons
v1.1.0
Published
Readme
uni-builder-icons
Getting started
Although it’s possible to use this package directly, we recommend using the icons in this package through [Icon] component.
Installation
Using npm:
npm install uni-builder-icons --saveOr, using Yarn:
yarn add uni-builder-iconsUsage
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 "@shopify/polaris";Import an icon from uni-builder-icons:
import { GridIcon } from "uni-builder-icons";Pass the imported Polaris icon to the
sourceprop of theIconcomponent:<Icon source={PlusIcon} />
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>