npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-icon-picker

v0.1.4

Published

Vue 3 icon picker

Downloads

870

Readme

Vue 3 Icon Picker npm (scoped)

Icon picker component

Installation

If you are using npm:

npm i vue3-icon-picker

If you are using yarn:

yarn add vue3-icon-picker

About

This package use icons from xicons with SVG components integrated from fluentui-system-icons, ionicons, ant-design-icons, material-design-icons, Font-Awesome, tabler-icons and carbon. Check this website for view icons list: https://www.xicons.org.

Demo

View the live demo here

Usage

You can add this package globally to your project:

// main.js
import { createApp } from 'vue'

import App from './App.vue'

import Vue3IconPicker from 'vue3-icon-picker'
import 'vue3-icon-picker/dist/style.css'

createApp(App).use(Vue3IconPicker).mount('#app')

If needed rename component to use:

createApp(App).use(Vue3IconPicker, { name: 'IconPicker' }).mount('#app') // use in template <IconPicker />

Alternatively you can also import the component locally:

<script setup>
 import { Vue3IconPicker } from 'vue3-icon-picker'
 import 'vue3-icon-picker/dist/style.css'
</script>

You can then use the component in your template

<template>
 <Vue3IconPicker v-model="icon" placeholder="Select icon" />
</template>

Props

| Name | Type | Description | Default | Required | | ---------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ----------------- | -------- | | v-model | string / string[] | Selection, icon(s) SVG code(s) or name(s) | null | Yes | | placeholder | string | Input placeholder | undefined | No | | multiple | boolean | Enable multiple selection when set to true | false | No | | multipleLimit | number | Maximum number of selections when multiple selection is enabled | Infinity | No | | selectedItemsToDisplay | number | Number of selected icons to display when multiple selection is enabled | 9 | No | | iconLibrary | 'all' / 'antd' / 'carbon' / 'fa' / 'fluent' / 'ionicons4' / 'ionicons5' / 'material' / 'tabler' | Icon library to display. This property can take an array of several libraries to display | 'fa' | No | | selectedIconBgColor | string | Selected icon(s) background color | '#d3d3d3' | No | | selectedIconColor | string | Selected icon(s) color | '#000000' | No | | clearable | boolean | Make selected icon clearable when multiple is false | false | No | | disabled | boolean | Disable component | false | No | | displaySearch | boolean | Display search input | true | No | | searchPlaceholder | string | Search input placeholder | 'Search' | No | | valueType | 'svg' / 'name' | Type of selection value, icon(s) SVG code(s) or name(s) | 'svg' | No | | includeIcons | string[] | List of icons to include | [] | No | | excludeIcons | string[] | List of icons to exclude | [] | No | | includeSearch | string | The search query whose results must be included | undefined | No | | excludeSearch | string | The search query whose results must be excluded | undefined | No | | emptyText | string | Empty text | 'Nothing to show' | No |

Slots

| Name | Parameters | Description | | ----- | ---------- | -------------------------------------- | | empty | () | Empty slot for the dropdown icons list |

Events

  • change
    • This event is fired when selection change.

Display icons

You can simply display icons like that if your value type is svg:

<script setup>
 const icon = ref(null)
</script>

<template>
 <Vue3IconPicker v-model="icon" placeholder="Select icon" />
 <i v-html="icon"></i>
</template>

Or use custom icon component provided by this package:

<script setup>
 import { Icon } from 'vue3-icon-picker'
 const icon = ref(null)
</script>

<template>
 <Vue3IconPicker v-model="icon" placeholder="Select icon" />
 <Icon :data="icon" :size="24" color="#124ebb"></Icon>
</template>

Icon Props

| Name | Type | Description | Default | Required | | ----- | --------------- | --------------------- | --------- | -------- | | data | string | Icon svg code or name | undefined | Yes | | size | number / string | Icon size | 24 | No | | color | string | Icon color | undefined | No |

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Changelog

Detailed changes for each release are documented in the release notes.

License

MIT