Coder Social home page Coder Social logo

trendingtechnology / oh-vue-icons Goto Github PK

View Code? Open in Web Editor NEW

This project forked from renovamen/oh-vue-icons

0.0 1.0 0.0 28.57 MB

A Vue component for including inline SVG icons from different icon packs easily.

Home Page: https://oh-vue-icons.vercel.app

License: Other

JavaScript 53.74% Shell 2.07% Vue 35.19% CSS 9.00%

oh-vue-icons's Introduction

Oh, Vue Icons!

A Vue component for including inline SVG icons from different icon packs in easily. Now the following icon packs are supported:

 

Documentation

Search for icons and view the documentation here.

 

Installation

yarn add oh-vue-icons
# or
npm install oh-vue-icons

 

Import

Global Import

Import oh-vue-icons and install it into Vue in main.js. You can choose to only import the icons you use to reduce bundle size, for example:

// main.js
import Vue from 'vue'
import App from './App.vue'
import OhVueIcon from 'oh-vue-icons/components/Icon'

import { FaFlag, RiZhihuFill } from 'oh-vue-icons/icons'
OhVueIcon.add([FaFlag, RiZhihuFill])

Vue.component('v-icon', OhVueIcon)

new Vue({
  render: h => h(App)
}).$mount('#app')

Or you can also import a whole icon pack if you don't care about bundle size, for example:

// main.js
// import Font Awesome and Remix Icon
import { Fa, Ri } from 'oh-vue-icons/icons'

OhVueIcon.add(Fa)
OhVueIcon.add(Ri)

 

Local Import

import OhVueIcon from 'oh-vue-icons/components/Icon'

export default {
  components: {
    'v-icon': OhVueIcon
  }
}

 

Usage

<template>
  <div>
    <v-icon name="fa-flag" />
    <v-icon name="ri-zhihu-fill" />
  </div>
</template>

The icons are organized as follows:

  • The prefixes of the name prop values of icons from Font Awesome, Remix Icon, academicons and gameicons are fa, ri, ai, si, wi and game.

  • For Font Awesome icons, icons from regular pack have name prop values like fa-regular-flag. Icons from solid and brands pack have name prop values like fa/beer and fa/github.

See the documentation for more about the usage.

 

Props

Name Description Type Accepted Values Default value
scale Icon size number / 1
animation Type of animation string wrench / ring / pulse / spin / spin-pulse /
hover Enable animation only when being hovered boolean true / false false
flip Used to flip icon string vertical / horizontal / both /
fill Fill color of icon string HEX color code or color name currentColor
label Icon lable string / /
title Icon title string / /
inverse Make icon color white? boolean true / false false

Some examples could be found in the documentation.

 

Development

Install dependencies:

yarn install

Fetch icon sources:

yarn submodule

Download some of the icons packs (gameicons):

yarn download

Re-generate files under src/icons automatically:

yarn build

Run docs:

yarn dev

 

Acknowledgements

This project is inspired by and based on Justineo/vue-awesome.

 

License

MIT

oh-vue-icons's People

Contributors

renovamen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.