Skip to content

📦 This package provides the Simple Icons packaged as a set of Svelte components.

License

Notifications You must be signed in to change notification settings

icons-pack/svelte-simple-icons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svelte simple icons

svelte-simple-icons

This package provides the Simple Icons 11.5.0 packaged as a set of Svelte components.

www.npmjs.com! builds! downloads licence

Installation

Install the package in your project directory with:

// with yarn
yarn add @icons-pack/svelte-simple-icons

// with npm
npm add @icons-pack/svelte-simple-icons

Usage

All icons are imported from a single file, where [ICON SLUG] is replaced by a capitalized slug.

Demo

Edit codesandbox

Basic example

  <!-- Import a specific icon by its slug as: -->
  <!-- import { Si[ICON SLUG] } from 'simple-icons'; -->

  <script>
    import { SiReact, SiSvelte, SiDocker } from "@icons-pack/svelte-simple-icons";
  </script>

  <SiSvelte color="#FF3E00" size={90} />

  <SiReactJs color="#61DAFB" size={50} />

  <SiDocker />

Change title

  <!-- title default "Svelte" -->
  <script>
    import { SiSvelte } from "@icons-pack/svelte-simple-icons";
  </script>

  <SiSvelte title="My title" />

Custom styles

  <script>
    import { SiSvelte } from "@icons-pack/svelte-simple-icons";
  </script>

  <SiSvelte class="myStyle" />

  <style>
    .myStyle {
      width: 35px;
      height: 35px;
    }
  </style>