Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@icon-park/vue-next

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icon-park/vue-next

Vue3 Icons for IconPark

  • 1.2.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
decreased by-47.73%
Maintainers
2
Weekly downloads
 
Created
Source

IconPark Icons

Vue3 Icons for IconPark

Introduction

Features

  • Provide more than 2000 icons
  • Provide 4 themes:
    • outline
    • filled
    • two-tone
    • multi-color

More

Please visit IconPark Website

  • Copy SVG
  • Copy React Icon component
  • Copy Vue Icon component
  • Download PNG
  • Download SVG

Getting Started

Install

npm install @icon-park/vue-next --save

Include Component

Import an icon from @icon-park/vue-nextat the top of a component and then use it in the template tag:

<template>
<home theme="filled"/>
</template>
<script>
import {Home} from '@icon-park/vue-next';

export default {
    components: {
        Home
    }
}
</script>

If you don't want to refer to it, you can install icons globally.

import {install} from '@icon-park/vue-next/es/all';
import {createApp} from 'vue';

const app = createApp({});

// Install
install(app); // use default prefix 'icon', eg: icon is People, name is icon-people.
install(app, 'i'); // use custom prefix 'i', eg: icon is People, name is i-people.

app.mount('#app');

Style Sheet

Import the icon style:

import '@icon-park/vue-next/styles/index.css';

Global Config

You can use IconProvider in @icon-park/vue-next to set the default config globally:

<template>
<div>
<home/>
</div>
</template>
<script lang="ts">
import {DEFAULT_ICON_CONFIGS, IconProvider} from '@icon-park/vue-next';
import {Home} from '@icon-park/vue-next';

export default {
    name: 'App',
    setup(){
        IconProvider({...DEFAULT_ICON_CONFIGS, prefix: 'icon'});
    },
    components: {
        Home
    }
};
</script>

Import on Demand

You can use babel-plugin-import to import icons on demand.

Set config like this:

{
    "plugins": [
        [
            "import",
            {
                "libraryName": "@icon-park/vue-next",
                "libraryDirectory": "es/icons",
                "camel2DashComponentName": false 
            }
        ]
    ]
}

Icon Component

We recommend loading icons on demand, because this can greatly reduce the volume of compiled code。 However, in some scenarios similar to remote loading menus, direct reference to all icons can reduce the development cost.

Usage:

<template>
<icon-park type="home" theme="filled"/>
</template>
<script>
import {IconPark} from '@icon-park/vue-next/es/all';

export default {
    components: {
        IconPark
    }
}
</script>

Embed IconPark in your project

If you need to use additional information such as icon name, author, category, label and creation time, you can use the icons.json file located in the root directory of each NPM.

Props

propdescriptiontypedefaultnote
themeTheme of the icons.'outline' | 'filled' | 'two-tone' | 'multi-color''outline'
sizeThe width/height of the iconnumber | string'1em'
spinRotate icon with animationbooleanfalse
fillColors of themestring | string[]'currentColor'
strokeLinecapthe stroke-linecap prop of svg element'butt' | 'round' | 'square''round'
strokeLinejointhe stroke-linejoin prop of svg element'miter' | 'round' | 'bevel''round'
strokeWidththe stroke-width prop of svg elementnumber4

Keywords

FAQs

Package last updated on 04 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc