kanban-column
A board column: a heading with a count and an optional work-in-progress limit, its cards (the default slot) and a drop zone for cards dragged from anywhere on the board.
Try it: events appear here (carddrop).
Source: kanban-column.zb, and its registry item.
Install
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/kanban-column.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/kanban-column.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/kanban-column.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/kanban-column.json
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/kanban-column.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/kanban-column.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/kanban-column.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/kanban-column.json
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/kanban-column.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/kanban-column.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/kanban-column.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/kanban-column.json
<link rel="stylesheet" href="https://zubra-js.github.io/zubra-ui/themes/default.css">
<script type="module" src="https://zubra-js.github.io/zubra-ui/cdn/kanban-column.js"></script>The compiled install writes src/components/zubra/kanban-column.js and the theme, and adds @zubra/runtime to your dependencies. The one-file install writes the same path as a plain custom element that needs nothing installed (or download it and load it with a <script type="module">); it's smaller on a page with one to three components, the shared runtime with more.
Usage
<kanban-column heading="In progress">
<article id="card-notes" draggable="true">Write the release notes</article>
<article id="card-theme" draggable="true">Review the theme picker</article>
</kanban-column>
<script type="module">
import './components/zubra/kanban-column.js';
const element = document.querySelector('kanban-column');
element.count = 2;
element.limit = 3;
element.addEventListener('carddrop', (event) => console.log('carddrop', event.detail));
</script>import './components/zubra/kanban-column.js';
const count = 2;
const limit = 3;
export function KanbanColumnExample() {
return (
<kanban-column
heading="In progress"
count={count}
limit={limit}
oncarddrop={(event) => console.log('carddrop', event.detail)}
>
<article id="card-notes" draggable="true">Write the release notes</article>
<article id="card-theme" draggable="true">Review the theme picker</article>
</kanban-column>
);
}<script setup>
import './components/zubra/kanban-column.js';
const count = 2;
const limit = 3;
const onCarddrop = (event) => console.log('carddrop', event.detail);
</script>
<template>
<kanban-column
heading="In progress"
:count.prop="count"
:limit.prop="limit"
@carddrop="onCarddrop"
>
<article id="card-notes" draggable="true">Write the release notes</article>
<article id="card-theme" draggable="true">Review the theme picker</article>
</kanban-column>
</template>
<!-- vite.config.js: vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.includes('-') } } }) --><script>
import './components/zubra/kanban-column.js';
const count = 2;
const limit = 3;
</script>
<kanban-column
heading="In progress"
{count}
{limit}
oncarddrop={(event) => console.log('carddrop', event.detail)}
>
<article id="card-notes" draggable="true">Write the release notes</article>
<article id="card-theme" draggable="true">Review the theme picker</article>
</kanban-column>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import './components/zubra/kanban-column.js';
@Component({
selector: 'app-kanban-column-example',
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `
<kanban-column
heading="In progress"
[count]="count"
[limit]="limit"
(carddrop)="onCarddrop($event)"
>
<article id="card-notes" draggable="true">Write the release notes</article>
<article id="card-theme" draggable="true">Review the theme picker</article>
</kanban-column>
`,
})
export class KanbanColumnExample {
count = 2;
limit = 3;
onCarddrop(event: Event) {
console.log('carddrop', (event as CustomEvent).detail);
}
}API
| Property | Type | Default |
|---|---|---|
heading | string | "" |
count | number | 0 |
limit | number | 0 |
| Event | When |
|---|---|
carddrop | A card was dropped here; detail is { id, index } (where among the cards). |
| Slot | For |
|---|---|
(default) | The cards: any elements with draggable="true". A card dragged out of a column carries its id (or data-id, or its text) as application/x-card drag data, which the drop reports; set that data yourself to drag in from elsewhere. |
actions | Buttons under the cards. |
Size
1.8 KB gzipped for the component, plus the runtime, which every Zubra component on a page shares (up to 22.1 KB, all of it). On its own, with the parts of the runtime it uses, it's 18.4 KB.