---
title: "Shadcn Kanban Board"
description: "Shadcn Kanban Board. A React Kanban board with drag-and-drop cards between columns, built for shadcn/ui and Tailwind, in a GSAP and a Motion build."
url: https://avaraui.com/docs/nextjs/kanban-board
---

# Shadcn Kanban Board

A React Kanban board with drag-and-drop cards between columns, spring dragging and a keyboard-friendly grip.

## Installation

Add the component by URL — no setup needed:

```bash
npx shadcn@latest add https://avaraui.com/r/kanban-board.json
```

Or register the @avara-ui registry once per project and add it by name:

```bash
npx shadcn@latest registry add @avara-ui=https://avaraui.com/r/{name}.json
npx shadcn@latest add @avara-ui/kanban-board
```

Or the Motion build (same props, same file — install one):

```bash
npx shadcn@latest add https://avaraui.com/r/kanban-board-motion.json
```

## Board

Columns of cards. Drag a card up or down a column, or onto another one; the rest glide aside.

- `columns` sets the columns; each card's `column` says where it sits.
- `onReorder` returns the cards with each moved card's new `column`.

```tsx
import KanbanBoard, { type KanbanCardItem } from "@/components/custom/kanban-board";

const columns = [
  { id: "todo", title: "To do" },
  { id: "doing", title: "In progress" },
  { id: "done", title: "Done" },
];

const items: KanbanCardItem[] = [
  { id: "1", title: "System performance audit", description: "Split the bundle and bring LCP under 0.8 s.", date: "Aug 30", badge: "Performance", column: "todo" },
  { id: "2", title: "Security vulnerability patch", description: "Upgrade dependencies and rotate API tokens.", date: "Aug 31", badge: "Security", column: "doing" },
  { id: "3", title: "Component library release", description: "Publish 2.4 with dark mode tokens.", date: "Sep 2", badge: "Library", column: "done", linkText: "View release notes", linkUrl: "/releases/2-4" },
];

export default function Sprint() {
  return (
    <KanbanBoard
      items={items}
      columns={columns}
      title="Sprint board"
      onReorder={(next) => console.log(next.map((i) => [i.id, i.column]))}
    />
  );
}
```

## About Shadcn Kanban Board

**What it is.** `KanbanBoard` is a drag-and-drop Kanban board for React. Cards carry a title, a note, a date, a badge and an optional link, and sit in columns you define. It reports every move through `onReorder`.

**How it is built.** It ships as a GSAP build (the default) and a Motion build. Both lift a copy of the held card, find the column and slot under the pointer and glide the other cards aside, then settle the card home on release. A mouse or pen drags from anywhere on a card; a finger drags by the grip so the page still scrolls. On narrow screens the columns scroll sideways, and the lane scrolls itself while a card is held near its edge.

**When to use it.** Task boards, sprint boards, status pipelines and roadmaps where items move between stages. For a single reorderable list, use [Draggable Card List](https://avaraui.com/docs/nextjs/draggable-card-list).

## For AI agents

**When to use**

- A board where people move rich items between stages: tasks, sprints, support tickets, hiring pipelines

**When not to use**

- A single list where people only set the order: use [Draggable Card List](https://avaraui.com/docs/nextjs/draggable-card-list)
- Sorting a table by column: use [Data Table](https://avaraui.com/docs/nextjs/data-table)

**Agent notes**

- Default export and named `KanbanBoard`, with types `KanbanCardItem`, `KanbanColumn` and `KanbanBoardProps`, from `@/components/custom/kanban-board`. The Motion build installs as `kanban-board-motion`; install one
- It holds its own order and reports it through `onReorder`. Pass a new `items` array to reset it
- Pass `columns` (`{ id, title }[]`; default To do, In progress, Done). A card names its column with `column`, and a moved card comes back from `onReorder` with its new `column`
- Cards: `{ id, title, description?, date?, badge?, hue?, linkText?, linkUrl?, column? }`. `hue` is 0 to 360; without it the colour comes from the badge, so it stays the same
- Keyboard: focus the grip and press Arrow Up or Arrow Down to move within a column, Arrow Left or Arrow Right to move to the next column
- Honours `prefers-reduced-motion`

## Props Reference

| Component | Prop | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `KanbanBoard` | `items` | `KanbanCardItem[]` | four sample tasks | The cards, in order. |
| `KanbanBoard` | `columns` | `{ id, title }[]` | To do, In progress, Done | The columns, left to right. |
| `KanbanBoard` | `onReorder` | `(items) => void` | - | Called with the new order after each move. |
| `KanbanBoard` | `title / subtitle` | `string` | - | Heading above the board. |
| `KanbanBoard` | `enableBadges` | `boolean` | `true` | Show the badge chips. |
| `KanbanBoard` | `className / cardClassName` | `string` | - | Classes for the board and for each card. |

## Works with other components

- Open a card's details in a [Drawer](https://avaraui.com/docs/nextjs/drawer) from its link.
- Show progress through the board with [Counter](https://avaraui.com/docs/nextjs/counter) (`circular`).
- Use [Draggable Card List](https://avaraui.com/docs/nextjs/draggable-card-list) when there is one list and no stages.

## How do I build a Kanban board with shadcn/ui?

Install `kanban-board` from the registry, pass `columns` and `items` (each with a `column` id) and render `KanbanBoard`. It uses your theme's CSS variables, so it follows your shadcn/ui colours and dark mode.

## How do I get the new order after a drag?

Pass `onReorder`. It receives the whole array in its new order after every move, and each moved card carries its new `column`, so you can save it. The board keeps the order itself, so you do not have to feed it back.

## Can I move cards with the keyboard?

Yes. Tab to a card's grip and press Arrow Up or Arrow Down to move it within its column, or Arrow Left or Arrow Right to move it to the next column. A screen reader hears the new column and position.

## Does dragging work on touch screens?

Yes, by the grip. A finger on the body of a card scrolls the page, and a finger on the grip drags the card. A mouse or a pen can drag from anywhere on the card.

## What is the difference between the GSAP and Motion builds?

They look and move the same. Install `kanban-board` for the GSAP build or `kanban-board-motion` for the Motion one, whichever your project already uses; one item never ships both.

---

Live previews and every example: https://avaraui.com/docs/nextjs/kanban-board
