All Projects → nash403 → graphicon

nash403 / graphicon

Licence: MIT License
A Vue.js plugin/component to help you manage your icons seamlessly

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects

Projects that are alternatives of or similar to graphicon

Font Awesome
The iconic SVG, font, and CSS toolkit
Stars: ✭ 66,937 (+557708.33%)
Mutual labels:  icons, svg-icons
SketchSVG
Have icons in a Sketch file but don't want to manually extract and compress them as SVGs? Let our SketchSVG tool do it!
Stars: ✭ 23 (+91.67%)
Mutual labels:  icons, svg-icons
majesticons
A versatile, beautiful, and scalable iconset. 760 icons each in line and solid style.
Stars: ✭ 98 (+716.67%)
Mutual labels:  icons, svg-icons
Small N Flat
svg icons on a 24px grid
Stars: ✭ 205 (+1608.33%)
Mutual labels:  icons, svg-icons
phosphor-figma
A flexible icon family for Figma
Stars: ✭ 17 (+41.67%)
Mutual labels:  icons, svg-icons
React Kawaii
Cute SVG React Components
Stars: ✭ 2,709 (+22475%)
Mutual labels:  icons, svg-icons
svelte-simple-icons
📦 This package provides the Simple Icons packaged as a set of Svelte components.
Stars: ✭ 27 (+125%)
Mutual labels:  icons, svg-icons
Webfont
Awesome generator of webfont
Stars: ✭ 170 (+1316.67%)
Mutual labels:  icons, svg-icons
vector-icons
Free Vector icons for Website and Mobile App
Stars: ✭ 28 (+133.33%)
Mutual labels:  icons, svg-icons
mdn-dinocons
A scalable set of icons for use across Mozilla Developer websites
Stars: ✭ 21 (+75%)
Mutual labels:  icons, svg-icons
Vue Eva Icons
Is a pack of more than 480 beautiful open source Eva icons as Vue components
Stars: ✭ 189 (+1475%)
Mutual labels:  icons, svg-icons
icons-flat-osx
Free Flat icons For OSX
Stars: ✭ 371 (+2991.67%)
Mutual labels:  icons, svg-icons
Feathericon
simply generic vector icon collection - including sketch file, svg files, and font files.
Stars: ✭ 178 (+1383.33%)
Mutual labels:  icons, svg-icons
Vectorlogozone
3,000+ gorgeous SVG logos, perfect for your README or credits page
Stars: ✭ 239 (+1891.67%)
Mutual labels:  icons, svg-icons
File Icon Vectors
A collection of file type icons in SVG format
Stars: ✭ 171 (+1325%)
Mutual labels:  icons, svg-icons
ionicons-sprite
SVG sprite icon set based on Ionicons icons
Stars: ✭ 22 (+83.33%)
Mutual labels:  icons, svg-icons
Cryptocurrency Icons
A set of icons for all the main cryptocurrencies and altcoins, in a range of styles and sizes.
Stars: ✭ 2,116 (+17533.33%)
Mutual labels:  icons, svg-icons
Materialdesign Svg
@mdi/svg Dist for Material Design Icons.
Stars: ✭ 166 (+1283.33%)
Mutual labels:  icons, svg-icons
WP-SVG-Icons-WordPress-Plugin
WPIcons Plugin (Formally WP SVG Icons) - Quickly and easily install font icons and custom SVG icons on any WordPress site.
Stars: ✭ 18 (+50%)
Mutual labels:  icons, svg-icons
mojoicons
Handcrafted 100 Outline and Flat Icons for Free -
Stars: ✭ 23 (+91.67%)
Mutual labels:  icons, svg-icons

GraphIcon

A Vue.js plugin/component to help you manage your icons seamlessly

Installation

npm install graphicon or yarn add graphicon

Usage

  • Install the plugin:

    // Declare your icons
    import GIcon from 'graphicon' // or use `window.GraphIcon` in browsers
    
    // Here I use the svg-inline-loader for webpack to load contents of svg files
    // but you could any method that suits you
    // This will call `Vue.component('GIcon', GIcon)` internally (or with provided component name)
    Vue.use(GIcon, {
      'arrow-left': require('!svg-inline-loader!@/assets/icons/arrow-left.svg'),
      'arrow-right': [require('!svg-inline-loader!@/assets/icons/arrow-right.svg'), {...defaultSvgAttributes...}],
      // You can pass a `keepAttrs` key to keep attributes from the original svg tag.
      // The value can be either `true` to keep all attributes, or an array of keys to be kept.
      ...
    }/*, 'ComponentName' // (defaults: 'GIcon')  */)
    
    // Or just call at some point
    GIcon.setIcons({ ...your icons... })
  • Then use GIcon in your components:

    <!-- the GIcon component will render as `<i class="GIcon" v-html="[icon content]"></i>` -->
    
    <!-- call with icon name -->
    <GIcon name="icon-name" :options="{...}"/>
    
    <!-- or with raw svg string -->
    <GIcon rawSvg="svg contents here" :options="{...}"/>
    
    <!-- or if you use font-awesome for example you can just pass classes down to GIcon -->
    <GIcon :class="fa-icon-name fa-..." />
    
    <!-- Since v1.1.0 you can control sizes with more ease.
    box-size & font-size will set the width, the height and the font-size of the <i>.
    See also options section below. -->
    <GIcon name="icon-name" box-size="2em" font-size="2em" />

    If you didn't install the plugin with Vue.use you'll have to declare the GIcon component first:

    import GIcon from 'graphicon'
    
    {
      ...
      components: {
        GIcon
      },
      ...
    }

Options

The options props of GIcon is an object containing attributes that will be merged to default attributes and passed to the root svg element of icons. The defaults attributes are the following:

{
  "xmlns": "http://www.w3.org/2000/svg",
  "width": "1em",
  "height": "1em",
  "viewBox": "0 0 24 24",
  "fill": "none",
  "stroke": "currentColor",
  "stroke-width": 2,
  "stroke-linecap": "round",
  "stroke-linejoin": "round"
}

Example

  1. git clone the repo
  2. run cd graphicon/test && vue serve src/main.js and it will serve an example app at localhost:8080 (require @vue/cli to be installed)
  3. Enjoy 🎉

Licence

MIT License

Copyright (c) 2018 Honoré Nintunze

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Icons are from Feather icons.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].