Skip to content

SelectableList

A dual-pane list component combining a searchable select/dropdown on top with a table of selected items below. Supports infinite scroll, avatar display, color pickers per item, and additional custom fields.

Basic Usage

vue
<script setup>
import { ref } from 'vue'
import { SelectableList } from 'praxis-vue-ui'

const options = [
  { id: 1, name: 'Alice Johnson' },
  { id: 2, name: 'Bob Smith' },
  { id: 3, name: 'Carol Williams' },
]
const selected = ref([])
</script>

<template>
  <SelectableList
    title="Team Members"
    :options="options"
    :selected-items="selected"
    @update:selected-items="selected = $event"
  />
</template>

Props

Props
PropTypeDefaultDescription
optionsrequiredSelectableItem[]Available items to select from.
selectedItemsrequiredSelectableItem[]Currently selected items. Display in the table below the select.
titlerequiredstringLabel shown above the select input.
isRequiredbooleanfalseMarks the field as required.
placeholderstring'Choose item'Select input placeholder text.
labelFieldstring'name'Object property to use as display label.
valueFieldstring'id'Object property to use as unique key.
showColorPickerbooleanfalseShows a color picker column in the selected items table.
columnsstring[]['Color', 'Name', 'Actions']Column headers for the selected items table.
additionalFieldsAdditionalField[][]Extra editable fields per selected item (text, select, or input type).
disabledbooleanfalseDisables the select input.
showButtonDeletebooleantrueShows the delete button per row in the selected items table.
isInfinitybooleanfalseEnables infinite scroll mode on the select dropdown.
hasMorebooleanfalseIndicates more items available to load (used with isInfinity).
loadingScrollbooleanfalseShows a spinner at the bottom of the dropdown when loading more.
loadMoreScroll() => Promise<void>undefinedAsync function called when the user scrolls to the bottom of the dropdown.
searchFunction(query: string) => voidundefinedCustom search handler. Called on input change instead of local filtering.
showAvatarbooleanfalseShows a BaseAvatar in each option row.

Emits

Emits
EventPayloadDescription
update:selectedItemsSelectableItem[]Emitted when an item is added or removed from the selected list.
update:optionsSelectableItem[]Emitted when the options list is modified (e.g. infinite scroll).

Built with VitePress