Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/metonym/svelte-polaris-icons

Shopify Polaris SVG icons as Svelte components
https://github.com/metonym/svelte-polaris-icons

icons polaris shopify shopify-polaris svelte svelte-component svg

Last synced: 26 days ago
JSON representation

Shopify Polaris SVG icons as Svelte components

Awesome Lists containing this project

README

        

# svelte-polaris-icons

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

> Shopify Polaris SVG icons as Svelte components.

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).

---

## 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

import {
AddMajor,
ArrowUpMinor,
MobilePlusMajor,
StoreMinor,
} from "svelte-polaris-icons";

```

### Direct import

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

```html

import ExportMinor from "svelte-polaris-icons/lib/ExportMinor.svelte";

```

## Using `svelte:component`

```svelte

import * as Icons from "svelte-polaris-icons";

{#each Object.keys(Icons) as icon}



{icon}

{/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