Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/rodneylab/svelte-social-icons

Beautiful, easy SVG social icons in Svelte
https://github.com/rodneylab/svelte-social-icons

icon icons social-network svelte sveltekit svg

Last synced: 4 days ago
JSON representation

Beautiful, easy SVG social icons in Svelte

Awesome Lists containing this project

README

        

Rodney Lab svelte-social-icons Github banner



Rodney Lab logo



Svelte Social Icons

# svelte-social-icons

[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/rodneylab/svelte-social-icons)

Social icons for Svelte. Based on react-social-icons by Jake Trent.

To install:

```
pnpm install @rodneylab/svelte-social-icons
```

Alternatively, replace `pnpm` with `npm` or run `yarn add @rodneylab/svelte-social-icons`.

To use:

```

import SocialIcons from '@rodneylab/svelte-social-icons';

```

![Svelte Social Icons - icons shown for 47 popular social networks in native colours](https://github.com/rodneylab/svelte-social-icons/raw/main/images/svelte-social-icons-regular.png)

- Change icon size:

```html

```

![Svelte Social Icons - icons shown for 47 popular social networks in native colours, icons are smaller than previous image](https://github.com/rodneylab/svelte-social-icons/raw/main/images/svelte-social-icons-small.png)

- Change foreground and background colours:

```html

```

![Svelte Social Icons - icons shown for 47 popular social networks with themed dark background and light foreground colours](https://github.com/rodneylab/svelte-social-icons/raw/main/images/svelte-social-icons-background.png)

![Svelte Social Icons - icons shown for 47 popular social networks with themed light background and dark foreground colours](https://github.com/rodneylab/svelte-social-icons/raw/main/images/svelte-social-icons-foreground.png)

![Svelte Social Icons - icons shown for 47 popular social networks in rainbow colours each icon has background set to one of the six rainbow colours and colours alternate in sequence](https://github.com/rodneylab/svelte-social-icons/raw/main/images/svelte-social-icons-rainbow.png)

## Props

| Property | Type | Required | Description |
| :------- | :------ | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| network | Network | Yes | Override which network icon to render. You can import the type if you need it in TypeScript: `import type { Network } from '@rodneylab/svelte-social-icons';` |
| bgColor | String | No | Override the background fill colour (defaults to social network's color). |
| fgColor | String | No | Override the icon's fill colour (defaults to transparent). |
| style | Object | No | Override style properties passed to the rendered anchor tag. |