Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vue-cool-select

iliyaZelenko6kMIT3.5.2TypeScript support: included

Vue select with autocomplete and with slots. 2 themes: bootstrap 4, material design.

vue, select, autocomplete, vue.js, slots, bootstrap, bootstrap 4, material design

readme

Coverage Downloads Version License CircleCI Build Status Language grade: JavaScript codebeat badge codebeat badge Downloads Contributors

The current version is 3.x, if you are looking for 2.x, you can find it here (also, see breaking changes).

Flexible select Tweet

Demo + Documentation

Features

  • no dependencies
  • props (30) allow you to customize a component in a various ways
  • slots (13) allow content to be changed anywhere
  • events (8) will let you know about everything
  • autocomplete (you can use custom search, you can also disable the search input)
  • keyboard controls (not only through the arrows)
  • support on mobile devices
  • validation, state of error and success
  • disabled and readonly
  • small and large sizes (as in bootstrap)
  • the ability to set your styles, you can write theme from scratch. 2 themes: Bootstrap 4 (equal styles), Material Design
  • TypeScript support
  • tab navigation
  • SSR (Server-Side Rendering)

  • auto determine the suitable position for the menu if it goes beyond the viewport

Write your suggestions, glad to add.

Installation

yarn add vue-cool-select or npm install --save vue-cool-select

Get started

NPM

  1. Import this plugin, css (theme) and add plugin via Vue.use: `js import { CoolSelectPlugin } from 'vue-cool-select'

// paste the line below only if you need "bootstrap" theme import 'vue-cool-select/dist/themes/bootstrap.css' // paste the line below only if you need "material-design" theme import 'vue-cool-select/dist/themes/material-design.css' // you can also import your theme

Vue.use(CoolSelectPlugin)


2. Use inside another component:
```js
import { CoolSelect } from 'vue-cool-select'

export default {
  components: { CoolSelect },
  data () {
    return {
      // simple example of items
      items: ['Item 1', 'Item 2', 'Item 3'],
      // there will be a selected item
      selected: null
    }
  }
}
  1. Add to <template>:
<cool-select
  v-model="selected"
  :items="items"
/>

Browser (CDN)

Include vue-cool-select in the page.

<script src="https://unpkg.com/vue-cool-select"></script>

<!-- paste the line below only if you need "bootstrap" theme -->
<link rel="stylesheet" href="https://unpkg.com/vue-cool-select/dist/themes/bootstrap.css">
<!-- paste the line below only if you need "material-design" theme -->
<link rel="stylesheet" href="https://unpkg.com/vue-cool-select/dist/themes/material-design.css">

If Vue is detected in the Page, the plugin is installed automatically.


Documentation and examples here.

TODO

  • multi-select
  • 100% tests coverage

I am happy to add something or improve, you can write what you want to see. I also have more motivation to work if you give a star, thanks! :smile:

changelog

3.5.2 (2020-02-04)

Bug Fixes

  • pin core-js to 3.4.6 (081a676)
  • types: incorrect work with config strict: true (0f1d2f8), closes #315
  • types: incorrect work with config strict: true (8fbb9a5)

3.5.1 (2019-11-12)

Bug Fixes

  • input event on component's created hook. The items prop is not required when simple-input prop (b2c17b4)

3.5.0 (2019-11-06)

Bug Fixes

  • component: fixes #254 - Remove async from showMenu() (223160f)

3.4.0 (2019-11-04)

Features

  • props: simple-input prop (4c534cc)

3.3.0 (2019-10-24)

Features

  • component: add prop to toggle full input selection on click/focus (dc1b997)

3.2.0 (2019-10-17)

Features

  • menu: new props: menuDynamicPosition, menuDefaultPosition. Smart position for menu (6a30ed3), closes #228 #234

3.1.0 (2019-09-30)

Features

  • plugin: auto-install for CDN usage (script tag) (2174ad1), closes #213

3.0.2 (2019-09-18)

Bug Fixes

  • ssr: access window only on client (84c042b)

3.0.1 (2019-09-18)

Bug Fixes

  • types: incorrect type setting fixed (e13ba79)

3.0.0 (2019-09-18)

Bug Fixes

  • getitemvalue: improve comparison to null and undefined (a53dfe4), closes #199

Features

  • build: added rollup, postcss (d901fd9)
  • classes: iZ-select--with-value class if select has value (c978a76)
  • component: different sizes (1e498e5)
  • component: improve the inputStyles logic and height style (1aeb01d)
  • plugin's options: the text option to set custom no data text (9698298)
  • props: arrowsDisableInstantSelection prop (59e9af4), closes #9
  • props: discard the loadingIndicator prop (0c18790)
  • sizes: changed the idea about different sizes (1abdf8d)

BREAKING CHANGES

  • props: loadingIndicator prop no longer exists
  • props: arrowsDisableInstantSelection now is true, previously there was the false value, which led to the immediate selection of a menu item. I decided that this was not the best practice.
  • component: the sizes are adjusted to fit the bootstrap styles perfectly, maybe they changed a little
  • build: new build system (styles separated)

2.11.1 (2019-09-13)

Bug Fixes

  • input: do not submit the form if there was a menu choice (if the component is inside the form) (50bc64d), closes #196

2.11.0 (2019-09-12)

Features

  • input: update component to ignore chrome autofill (b64671f)

2.10.2 (2019-03-29)

Bug Fixes

  • component: set tabindex to 0 instead of 1 (ebe593e), closes #98

2.10.1 (2019-03-29)

Bug Fixes

  • component: fixed opening the menu when you click again (046689f)

2.10.0 (2019-03-29)

Bug Fixes

  • component: fix circular call for methods (03053bd)
  • component: fix tab navigation (a03694b), closes #98
  • component: when you clear the elements, the selected element is not cleared (b184378), closes #42

Features

  • props: added inputForTextClass prop (ddb2c32), closes #90
  • slots: added 4 new slots for input (3f892e0), closes #98

2.9.0 (2019-03-17)

Bug Fixes

  • component: when you clear the elements, the selected element is not cleared (381ddcd), closes #42

Features

  • props: added inputForTextClass prop (3be99d8), closes #90

2.8.0 (2019-03-17)

Features

  • items menu: added scrollToItemIfNeeded with true by default (aec02ef), closes #50
  • props: added input-styles prop for custom styles on input (472d176), closes #2
  • props: added new prop disableFirstItemSelectOnEnter (ef56833), closes #53

2.7.0 (2019-03-08)

Features

  • items menu: added scrollToItemIfNeeded with true by default (cdaa072), closes #50
  • props: added new prop disableFirstItemSelectOnEnter (1483b9e), closes #53