HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sonner
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Kanban

PreviousNext

A board of columns with cards you drag within a column or across columns, and columns you drag to reorder. Controlled, keyboard friendly, and columns can collapse.

Base UIReact AriaRadix UI
Radix UI
To do2
Quote the patio rebuild
Fraser Valley Decks
JV$8,400
Chase September invoice
Harrison Dental
EV
In progress2
Set up GST/HST filing
Cultus Lake Rentals
JV
Landing page copy
Abbotsford Bakery
MC$1,950
Review1
Year end checklist
Hope Hardware
EV
Done0
Drop a card here

Installation#

pnpm dlx shadcn@latest add https://anotherui.dev/r/kanban.json

Usage#

import {
  Kanban,
  KanbanBoard,
  KanbanColumn,
  KanbanColumnContent,
  KanbanColumnHandle,
  KanbanColumnHeader,
  KanbanItem,
  KanbanOverlay,
} from "@/components/ui/kanban"
const [board, setBoard] = React.useState({
  todo: [{ id: "t1", title: "Quote the patio rebuild" }],
  doing: [{ id: "t2", title: "Set up GST/HST filing" }],
  done: [],
})
 
<Kanban value={board} onValueChange={setBoard}>
  <KanbanBoard>
    {Object.keys(board).map((column) => (
      <KanbanColumn key={column} value={column}>
        <KanbanColumnHeader>
          <KanbanColumnHandle />
          {column}
        </KanbanColumnHeader>
        <KanbanColumnContent>
          {board[column].map((task) => (
            <KanbanItem key={task.id} value={task.id} asHandle>
              <Card size="sm">{task.title}</Card>
            </KanbanItem>
          ))}
        </KanbanColumnContent>
      </KanbanColumn>
    ))}
  </KanbanBoard>
  <KanbanOverlay>
    {(drag) => (drag.type === "item" ? <Card size="sm">{drag.id}</Card> : null)}
  </KanbanOverlay>
</Kanban>

How the board changes#

value maps each column id to its items, in column order. Keep column ids as words, since keys that look like numbers always sort first in a JavaScript object.

  • A card moving into another column moves live while you drag, so the column makes room. onValueChange fires as it crosses.
  • A move inside one column, and a column move, land on drop.
  • Escape, or a drop outside the board, puts everything back.

onDragStart and onDragEnd tell you what moved. onDragEnd gets from, to, the new index and the final value, so you can save the change, such as a new status for a task.

Columns#

Columns only drag by a KanbanColumnHandle, so a board with no handles has fixed columns. Pass asChild to make a whole header the handle. disabled locks a column in place, so other columns cannot take its spot, but cards can still land in it.

collapsed narrows a column to a strip, and the width tweens with the card resize motion. Leave KanbanColumnContent out of a collapsed column and show a label instead.

Keyboard and touch#

Focus a card, press Space to pick it up, use the arrow keys to move it, and press Space again to drop. Enter is left free, so a card can open on Enter. On phones, press and hold a card to pick it up.

Props#

  • Kanban. value, onValueChange, getItemValue (for items without an id), onDragStart, onDragEnd, onDragCancel and accessibility for screen reader text.
  • KanbanBoard. The row of columns. Scrolls sideways. asChild lets you supply your own layout, such as swimlanes.
  • KanbanColumn. value is the column id. collapsed, disabled. Sets data-collapsed, data-dragging and data-over (a card is over an empty part of it).
  • KanbanColumnHeader, KanbanColumnContent. The top row and the list of cards.
  • KanbanColumnHandle, KanbanItemHandle. Six dot grip buttons. Both take asChild.
  • KanbanItem. value is the item id. asHandle drags the whole card. A click that ends a drop is ignored, so cards can open on click.
  • KanbanOverlay. What follows the pointer. A function gets { type, id, column }.
ItemKbd

On This Page

InstallationUsageHow the board changesColumnsKeyboard and touchProps