# svelte-polaris-icons

> Shopify Polaris SVG icons as Svelte components

Latest version **5.3.0** (published 2022-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install svelte-polaris-icons
pnpm add svelte-polaris-icons
yarn add svelte-polaris-icons
bun add svelte-polaris-icons
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.3.0 |
| Published | 2022-09-02 |
| First published | 2020-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 372.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Eric Liu |
| Maintainers | metonym |
| Keywords | svelte, svelte component, shopify, shopify polaris, polaris, icons, svg |

## Links

- npm: https://www.npmjs.com/package/svelte-polaris-icons
- Repository: https://github.com/metonym/svelte-polaris-icons
- Issues: https://github.com/metonym/svelte-polaris-icons/issues
- npm.io page: https://npm.io/package/svelte-polaris-icons

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 5.3.0 (latest) — 2022-09-02
- 5.2.0 — 2022-06-20
- 5.1.0 — 2022-04-03
- 5.0.0 — 2022-02-19
- 4.5.0 — 2021-03-23
- 4.1.0 — 2020-11-30
- 0.1.0 — 2020-04-27

## README

# svelte-polaris-icons

[![NPM][npm]][npm-url]

> Shopify Polaris SVG icons as Svelte components.

<!-- REPO_URL -->

This library builds icons from [Shopify Polaris](https://polaris-icons.shopify.com/) as Svelte components with zero dependencies.

Try it in the [Svelte REPL](https://svelte.dev/repl/52cb5e5d624b4f2cbb60a110b76161f0).

---

<!-- TOC -->

## Installation

```bash
# Yarn
yarn add -D svelte-polaris-icons

# NPM
npm i -D svelte-polaris-icons

# pnpm
pnpm i -D svelte-polaris-icons
```

## Usage

Refer to [ICON_INDEX.md](./ICON_INDEX.md) for a list of available icons.

### Base import

```svelte
<script>
  import {
    AddMajor,
    ArrowUpMinor,
    MobilePlusMajor,
    StoreMinor,
  } from "svelte-polaris-icons";
</script>

<AddMajor width={20} />
<ArrowUpMinor width={20} />
<MobilePlusMajor width={20} />
<StoreMinor width={20} />
```

### Direct import

The direct import method is recommended because it can lead to faster compile times.

```html
<script>
  import ExportMinor from "svelte-polaris-icons/lib/ExportMinor.svelte";
</script>
```

## Using `svelte:component`

```svelte
<script>
  import * as Icons from "svelte-polaris-icons";
</script>

{#each Object.keys(Icons) as icon}
  <div>
    <svelte:component this={Icons[icon]} title={icon} width={20} />
    {icon}
  </div>
{/each}
```

## TypeScript

Svelte version 3.31 or greater is required to use this library with TypeScript.

## Changelog

[Changelog](CHANGELOG.md)

## License

[MIT](LICENSE)

[npm]: https://img.shields.io/npm/v/svelte-polaris-icons.svg?color=%23ff3e00&style=for-the-badge
[npm-url]: https://npmjs.com/package/svelte-polaris-icons

---
_Source: https://npm.io/package/svelte-polaris-icons · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
