🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101

Kanban board with drag and drop

A Trello-style task board: columns, cards, drag and drop, labels and due dates.

Intermediate⏱ 10–14 hoursđŸĒœ 7 stepsReactTypeScriptdnd-kit

What you'll learn

  • ◆useReducer for complex state
  • ◆Drag and drop with dnd-kit
  • ◆TypeScript with React

What you'll build

  • ✓Add, rename and delete columns
  • ✓Cards with title, label, due date
  • ✓Drag cards within and across columns
  • ✓Saved automatically

Step-by-step guide

  1. 1

    Set up with TypeScript

    npm create vite@latest board -- --template react-ts; npm i @dnd-kit/core @dnd-kit/sortable.

  2. 2

    Model state

    type Board = { columns: { id, title, cardIds[] }[]; cards: Record<string, Card> } managed with useReducer and typed actions.

  3. 3

    Render

    Column and Card components; edit titles inline.

  4. 4

    Drag and drop

    Wrap in DndContext; each column is a SortableContext; in onDragEnd move the card id between arrays (arrayMove for same column).

  5. 5

    Labels and dates

    Coloured label chips and a due date that turns red when overdue.

  6. 6

    Persist

    Save the board to localStorage in a useEffect whenever state changes.

  7. 7

    Keyboard access

    dnd-kit supports keyboard sensors; enable them so the board is accessible.

🚀 Make it stand out

  • +Multiple boards
  • +Backend with Node/Express to share a board
  • +Undo with a history stack