Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/metonym/svelte-octicons

GitHub Octicons as Svelte components
https://github.com/metonym/svelte-octicons

github icon-library icons octicons primer svelte svelte-component svelte-components svg typescript-definitions

Last synced: 11 days ago
JSON representation

GitHub Octicons as Svelte components

Awesome Lists containing this project

README

        

# svelte-octicons

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

> GitHub Octicons as Svelte components.

This library builds [GitHub Primer Octicons](https://primer.style/octicons/) as Svelte components with zero dependencies.

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

---

## Installation

```sh
# npm
npm i -D svelte-octicons

# pnpm
pnpm i -D svelte-octicons

# Bun
bun i -D svelte-octicons

# Yarn
yarn add -D svelte-octicons
```

## Usage

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

### Base import

`$$restProps` are forwarded to the `svg` element.

```svelte

import { Alert16, Diamond16, Rocket16, Video16 } from "svelte-octicons";

```

### Custom fill

```svelte

```

## Usage with `svelte:component`

```svelte

import * as Octicons from "svelte-octicons";

{#each Object.entries(Octicons) as [octicon, component]}



{octicon}

{/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-octicons.svg?color=%23ff3e00&style=for-the-badge
[npm-url]: https://npmjs.com/package/svelte-octicons