Skip to main content

cardListEnd

Custom component rendered after the last card of every expanded card area. Use it for content that belongs at the bottom of a list, such as an "Add card" button or a list footer.

Usage​

cardListEnd?: Component<CardListSlotProps>;

The component receives these props (CardListSlotProps is exported from the package):

FieldTypeDescription
columnColumnViewThe column that owns the card area
swimlaneSwimlaneViewThe swimlane for a swimlane cell or a stack group; absent on an ordinary column
cardsKanbanCard[]All filtered and sorted cards in the area, including cards outside the virtual range
readonlybooleanThe current value of the readonly prop

cardListEnd follows the same rules as cardListStart:

  • The component renders once per expanded card area: in each column, swimlane cell, and stack group. Collapsed areas and exports don't include it.
  • It scrolls with the cards and stays mounted when render.virtualizeColumns hides card content.
  • It isn't a card. It can't be dragged, it isn't counted, and double-clicking it doesn't add a card.
  • A card dropped over it goes to the end of the area.
  • The widget doesn't wire any actions. The slot component dispatches them and must respect readonly.

The rendered wrapper has the wx-card-list-end CSS class.

Example​

<script setup>
import { ref, provide } from "vue";
import { Kanban } from "@svar-ui/vue-kanban";
import AddCardButton from "./AddCardButton.vue";

const api = ref(null);
provide("kanban-api", () => api.value);
</script>

<template>
<Kanban ref="api" :cards="cards" :columns="columns" :cardListEnd="AddCardButton" />
</template>

The slot component:

<!-- AddCardButton.vue -->
<script setup>
import { inject } from "vue";

const props = defineProps({
column: { type: Object },
readonly: { type: Boolean },
});
const getApi = inject("kanban-api");

function add() {
getApi()?.exec("add-card", {
card: { label: "New task", column: props.column.id },
});
}
</script>

<template>
<button :disabled="props.readonly" @click="add">+ Add card</button>
</template>
  • Columns - card list slots in context
  • Themes - styling .wx-card-list-start and .wx-card-list-end