Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/metonym/svelte-octicons
- Owner: metonym
- License: mit
- Created: 2020-04-23T00:23:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-05T21:04:27.000Z (2 months ago)
- Last Synced: 2024-10-14T08:43:42.864Z (25 days ago)
- Topics: github, icon-library, icons, octicons, primer, svelte, svelte-component, svelte-components, svg, typescript-definitions
- Language: TypeScript
- Homepage: https://metonym.github.io/svelte-octicons/
- Size: 2.19 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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