Giter VIP home page Giter VIP logo

vue-ionicons's Introduction

⛄ Vue Ionicons

Vue Icon Set Components from Ionic Team

License Travis version downloads

Design icons sourced from the Ionicons project.

🎉 Demo

https://mazipan.github.io/vue-ionicons

🚀 Getting started

  1. Install the package

    # NPM
    npm install --save vue-ionicons
    
    # Yarn
    yarn add vue-ionicons
  2. Import the icon, and declare it as a local component:

    import AlertIcon from 'vue-ionicons/dist/ios-alert.vue'
    // OR using transpiled js version
    // import AlertIcon from 'vue-ionicons/dist/js/ios-alert'
    
    components: {
      AlertIcon
    }

    OR

    Declare it as a global component:

    import AlertIcon from 'vue-ionicons/dist/ios-alert.vue'
    // OR using transpiled js version
    // import AlertIcon from 'vue-ionicons/dist/js/ios-alert'
    
    Vue.component('alert-icon', AlertIcon)

    Note Icon files are kebab cased, e.g. alert-circle.vue. All icon generated can be see in dist folder.

  3. Include global CSS/SCSS in your main.js

    # Using plain css
    require('vue-ionicons/ionicons.css')
    # Or using SCSS import
    @import('~vue-ionicons/ionicons.scss')
  4. Then use it in your template code!

    <AlertIcon />

Import some icon sets

Sometimes we don't want import one by one, so from v2.3.0 we can include this groups icon: ios, md, logo.

import AllIosIcon from 'vue-ionicons/dist/ionicons-ios.js'

Vue.use(AllIosIcon)

/*
-- File available --
Material: ionicons-md.js
Logo: ionicons-logo.js
All: ionicons.js
*/

Then you already can use component in your template, component tag is same with filename with adding -icon in postfix.

Example:

<ios-add-circle-outline-icon />
<ios-add-circle-icon />

<md-add-circle-outline-icon />
<md-add-circle-icon />

🔥 API and Props

Name Type Default Description
w String 14px Width of SVG
h String 14px Height of SVG
rootClass String empty Class for wrapper SVG
animate String empty Available: rotate, shake, beat

🏃 Development

Checkout with submodule :

git clone [email protected]:mazipan/vue-ionicons.git
git submodule init
git submodule update --remote

Run demo

npm run dev

Build demo

npm run build

Build new distribute icon

npm run dist

👍 Tips

  • Use resolve in your Webpack config to clean up the imports:

    resolve: {
      alias : {
        "icons": path.resolve(__dirname, "node_modules/vue-ionicons/dist")
      }
    }

    This will give you much shorter and more readable imports, like import Android from 'icons/android', rather than import Android from 'vue-ionicons/dist/android.vue'. Much better!

💵 Credits

Support me

🎁 Contributing

If you'd like to contribute, head to the contributing guidelines. Inside you'll find directions for opening issues, coding standards, and notes on development.

Copyright © 2017 Built with ❤️ by Irfan Maulana

vue-ionicons's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar hitautodestruct avatar irfan-maulana-tkp avatar jman avatar mazipan avatar nickknissen avatar romdim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue-ionicons's Issues

Global import set, what component to use?

Maybe I'm being thick..

But the docs don't mention what the component tag names are when you important entire sets using vue.use()

<ios-menu-icon/>

I would have thought something like the above?

Ability to change component title?

I want to be able to change component title because it appears as a tooltip on hover as shown in this screenshot. Tried to add a title attribute but it was overridden by the default title of the component.

<send-icon title="Send" />

chrome_2018-09-16_15-00-03

Remove too much gradient

After revisited the demo page, I feel too many gradient was not good for our page.
Make it more cleaner with less gradient.
Gradient only for header and maybe some of card.
Remove gradient in icon box

failed

follow the guide
there is a compile error on import AlertIcon from 'vue-ionicons/alert.vue'

Sizing by attribute should be optional.

Sizing by width / height makes styling by css difficult; also icons don't scale with user style sheets.

width/height bindings should be optional, and the base style be something like:

.ion__svg {
    overflow: visible;
    display: inline-block;
    height: 1em; /* possibly tweaked so icons match typical font x-heights; I use 1.1em along with margin-top: .05em */
    font-size: inherit;
}

Demo page not responsive

Please make it better for mobile device view.

[-] Make card become 💯% width.
[-] Make icon box become 3 in one row.
Etc...

How to import set of icons

I want to import globally set of [ios-*] icons. Is it possible with 3 or 4 lines of code without copy/paste? I've see /dist/ionicons.js file but don't understand how to use ioniconsPlugin im my VueJS App. Could anyone help me?

Support for all ios outline icons?

Hi there,

Am I right in that this currently supports a subset of the available ionic icons? It seems most of the ios-{ICON}-outline variants are missing?

Take for example ios-calendar-outline

Many thanks

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.