
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
vue3-icon-picker
Advanced tools
Icon picker component
If you are using npm:
npm i vue3-icon-picker
If you are using yarn:
yarn add vue3-icon-picker
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.
View the live demo here
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>
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 |
Name | Parameters | Description |
---|---|---|
empty | () | Empty slot for the dropdown icons list |
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>
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 |
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Detailed changes for each release are documented in the release notes.
FAQs
Vue 3 icon picker
The npm package vue3-icon-picker receives a total of 353 weekly downloads. As such, vue3-icon-picker popularity was classified as not popular.
We found that vue3-icon-picker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.