BaseListbox

A list you choose from, open on the page.

Import it from rei-kit: import { BaseListbox } from 'rei-kit'

Open BaseListbox in the live documentation, where every prop below is a control you can change, in four materials and ten palettes.

Usage

<script setup lang="ts">
import { ref } from 'vue'
import { BaseListbox } from 'rei-kit'

const chosen = ref<string[]>(['ada'])
const people = [
  { value: 'ada', label: 'Ada Lovelace', description: 'Owner' },
  { value: 'kenji', label: 'Kenji Mori', description: 'Editor' },
  { value: 'mei', label: 'Mei Lin', description: 'Invited', disabled: true },
]
</script>

<template>
  <BaseListbox v-model="chosen" mode="multiple" :options="people" label="People with access" />
</template>

Props

Props
PropTypeRequired or defaultWhat it is for
modelValueValueundefinedThe chosen option, or options, with `v-model`.
optionsreadonly ListboxOption<V>[]yes
labelstringyesThe list's accessible name.
modeM'single' as MOne option, or any number of them.
heightstring'14rem'How tall before it scrolls. Any CSS length.

About rei-kit

rei-kit is an accessible Vue 3 and Tailwind CSS 4 component library: 106 components, themed by role rather than by colour on three independent axes — ten WCAG-checked palettes, four materials and light or dark, each switched with one attribute. Typed, tested, SSR-safe, no runtime dependencies, MIT.

pnpm add rei-kit · npm · GitHub