Skip to content

TotomInc/vue3-select-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

777c032 Β· Apr 27, 2025
Mar 12, 2025
Jun 26, 2024
Apr 9, 2025
Feb 19, 2025
Apr 10, 2025
Apr 30, 2024
Feb 11, 2024
Feb 17, 2025
Feb 11, 2024
Feb 11, 2024
Apr 27, 2025
Apr 27, 2025
Dec 3, 2024
Dec 3, 2024
Dec 3, 2024
Feb 11, 2024
Dec 3, 2024
Feb 3, 2025
Dec 3, 2024

Repository files navigation


Vue3 Select Component

Vue3-Select-Component

Best-in-class select component for Vue 3, with a focus on DX, accessibility and ease-of-use.

npm package npm package GitHub stars

Documentation | Getting Started | Examples / Demos

Core features:

  • βš™οΈ Data manipulation with v-model
  • πŸ”‘ Typesafe relationship between options and v-model
  • 🎨 Great styling out-of-the-box, customization with CSS variables & Vue :deep
  • βœ… Single & multi-select support
  • πŸ–ŒοΈ Infinite customization with <slot>s
  • πŸͺ„ <Teleport /> menu where you want
  • πŸ“¦ Extremely light, 0 dependencies (4.4kb gzip)

Installation

Install the package with npm:

npm i vue3-select-component

Use it in your Vue 3 app:

<script setup lang="ts">
import { ref } from "vue";
import VueSelect from "vue3-select-component";

const option = ref("");
</script>

<template>
  <div class="my-app">
    <VueSelect
      v-model="option"
      :options="[
        { label: 'A Wizard of Earthsea', value: 'wizard_earthsea' },
        { label: 'Harry Potter and the Philosopher\'s Stone', value: 'harry_potter', disabled: true },
        { label: 'The Lord of the Rings', value: 'the_lord_of_the_rings' },
      ]"
    />
  </div>
</template>

Advanced TypeScript usage

Vue 3 Select Component creates a type-safe relationship between the option.value and the v-model prop.

It also leverages the power of generics to provide types for additional properties on the options.

<script setup lang="ts">
import type { Option } from "vue3-select-component";
import { ref } from "vue";
import VueSelect from "vue3-select-component";

type UserOption = Option<number> & { username: string };

const selectedUser = ref<number>();

const userOptions: UserOption[] = [
  { label: "Alice", value: 1, username: "alice15" },
  { label: "Bob", value: 2, username: "bob01" },
  { label: "Charlie", value: 3, username: "charlie20" },
];
</script>

<template>
  <VueSelect
    v-model="selectedUser"
    :options="userOptions"
    :get-option-label="(option) => `${option.label} (${option.username})`"
    placeholder="Pick a user"
  />
</template>

There's an entire documentation page dedicated to usage with TypeScript.

Releases

For changelog, visit releases.

License

MIT Licensed. Copyright (c) Thomas Cazade 2024 - present.