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
Set up with TypeScript
npm create vite@latest board -- --template react-ts; npm i @dnd-kit/core @dnd-kit/sortable.
- 2
Model state
type Board = { columns: { id, title, cardIds[] }[]; cards: Record<string, Card> } managed with useReducer and typed actions.
- 3
Render
Column and Card components; edit titles inline.
- 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
Labels and dates
Coloured label chips and a due date that turns red when overdue.
- 6
Persist
Save the board to localStorage in a useEffect whenever state changes.
- 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