Skip to content

Installation

Install the package

sh
npm install vue-pick
sh
pnpm add vue-pick
sh
yarn add vue-pick

Import the stylesheet

Import the base CSS once in your app entry. The component will not render correctly without it.

ts
import { createApp } from "vue"
import App from "./App.vue"
import "vue-pick/style.css"

createApp(App).mount("#app")
ts
import Vue from "vue"
import App from "./App.vue"
import "vue-pick/style.css"

new Vue({ render: (h) => h(App) }).$mount("#app")

Vue 2.7 vs Vue 3 imports

Both components are available from separate entry points. The API is identical — only the import path changes.

ts
// Vue 3
import { VPickNative, VPick } from "vue-pick"

// Vue 2.7
import { VPickNative } from "vue-pick/vue2"

TIP

VPick is Vue 3 only in the current release. Use VPickNative for Vue 2.7 projects.

Other CSS import strategies

You can also import the stylesheet from a central CSS file or directly inside a component:

css
/* main.css */
@import "vue-pick/style.css";
vue
<!-- SomeComponent.vue -->
<script setup>
import { VPickNative } from "vue-pick"
import "vue-pick/style.css"
</script>

Released under the MIT License.