Skip to content
Star

PxSelectableListWithTable

Renders a set of selected items in a table with a remove button per row, wired to a vee-validate field. It doesn't include a picker itself — you provide one via the selector slot (e.g. a VueSelect, a native <select>, or a button that opens a dialog) and add to your own array; the component only displays what you give it via selectedItems and asks to remove via the remove emit.

No v-model — you own the array

There is no selectedItems two-way binding. Add items yourself (from whatever the selector slot does) and remove them in your @remove handler — the component never mutates selectedItems itself.

Known display bug: the count badge doesn't render

The template references a bare <Badge> component that isn't imported or globally registered anywhere in the library, so Vue can't resolve it — the item-count badge next to the label silently doesn't render (you'll see a "Failed to resolve component: Badge" warning in the console). The badgeState prop currently has no visible effect.

Usage

Demo
No.NameCategoryAction

Props

PropTypeDefaultDescription
labelrequiredstringField label, rendered via PxRequiredLabel.
requiredbooleanfalseShows the required indicator next to the label.
namerequiredstringField name registered with vee-validate.
selectedItemsrequiredunknown[]Items to render as table rows. You own this array — the component only reads it.
columnsrequired{ key: string; label: string; getValue?: (item) => string }[]Column definitions. getValue overrides reading item[key] directly, useful for computed/fallback display values.
badgeState{ class?: string; severity?: string }{ class: 'count-badge', severity: 'secondary' }Intended to style the item-count badge — currently has no visible effect (see warning above).
rulesstringundefinedvee-validate rules applied to the selectedItems field, e.g. 'required'.
marginClassstring'mb-8'Class applied to the outer wrapper for spacing.

Slots

SlotDescription
selectorYour own picker UI (select, async search, dialog trigger, etc.) for adding new items to selectedItems.

Emits

EventPayloadDescription
removeitemEmitted with the row's item when its remove button is clicked. Filter it out of your own array in response.

Built with VitePress