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

vue-custom-select

v1.0.10

Published

simple, minimalistic autocomplete select dropdown component for Vue apps for you!

Downloads

32

Readme

vue-custom-select

simple, minimalistic autocomplete select dropdown component for Vue apps for you!
  • ~4kb (the component size)
  • SSR Support
  • Zero dependencies
  • Minimalistic
  • Convenient and easy to use
  • Floating placeholder

Install Via NPM

$ npm i vue-custom-select

Register it

In your component:

import vueCustomSelect from 'vue-custom-select/src/CustomSelect.vue';

export default {
  components: {
     vueCustomSelect
  },
  //...
}

Globally:

import Vue from 'vue';
import vueCustomSelect from "vue-custom-select/src/CustomSelect.vue";
Vue.component('vue-custom-select', vueCustomSelect);

Use It

<vue-custom-select 
  v-model="selectedOption"
  :data-array="dataArray"
  placeholder="Choose your country">
</vue-custom-select>

Use v-model to get the selected option, or set standard value. The standard value must be something like this '{text: 'First option', value: 'Any'}', the 'text' property is required

Data array must be something like this:

data () {
    return {
      dataArray: [
        {text: 'First option', value: 'Any'},
        {text: 'Second option', value: 'Any'},
        {text: 'Third option', value: 'Any'},
        {text: 'Fourth option', value: 'Any'},
        {text: 'Fifth option', value: 'Any'},
        {text: 'Sixth option', value: 'Any'}
      ]
    }
  }

where the key 'text' will be a title of your options

And you will get a result:

Customize CSS

If you don't like styles, you can customize it just using selector /deep/, for example:

.your-wrap-class /deep/ .select-input {
    background: lightblue;
}

where "your-wrap-class" it's parent class in your code

Available Props:

props: {
  // Array list of your elements/options 
  dataArray: {
    type: Array,
    'default': []
  },
  // Set width
  width: {
    type: Number,
    'default': 300
  },
  // Set height
  height: {
    type: Number,
    'default': 60
  },
  // Set custom placeholder
  placeholder: {
    type: String,
    'default': 'Choose an option'
  }
}

Github link:

https://github.com/Orangat/vue-custom-select Fill free to create some issue, if you find some bugs, or want to improve something. If you have questions, write me 'serg,[email protected]'