Zubra UI
Code for
GitHub

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.

Write the release notes
Review the theme picker

Try it: events appear here (carddrop).

Source: kanban-column.zb, and its registry item.

Install

Compiled (any project)
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
One file, no dependencies (4.8 KB gzipped)
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
.zb source (to edit it with Zubra)
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
No build: a script tag, straight from this site
HTML
<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

index.html
<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>
Example.jsx
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>
  );
}
Example.vue
<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('-') } } }) -->
Example.svelte
<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>
example.component.ts
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

Properties (each is also an HTML attribute of the same name, unless marked)
PropertyTypeDefault
headingstring""
countnumber0
limitnumber0
Events
EventWhen
carddropA card was dropped here; detail is { id, index } (where among the cards).
Slots
SlotFor
(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.
actionsButtons 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.

Theme

Every component reads shadcn/ui's CSS variables, so any shadcn theme works. Pick a look or a colour, or paste a theme's CSS.

Look: colours, fonts, corners and motion

Accent colour