
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
react-kanban-component
Advanced tools
A fully customizable, animated kanban board component for React with TypeScript and TailwindCSS
A fully customizable, animated kanban board component for React with TypeScript and TailwindCSS support.
npm install react-kanban-component
npm install react react-dom
import React, { useState } from 'react';
import { KanbanBoard, KanbanBoardData } from 'react-kanban-component';
const initialBoard: KanbanBoardData = {
columns: [
{
id: 'todo',
title: 'To Do',
cards: [
{
id: '1',
title: 'Task 1',
description: 'This is a sample task',
priority: 'high',
tags: ['urgent'],
}
]
},
{
id: 'doing',
title: 'In Progress',
cards: []
},
{
id: 'done',
title: 'Done',
cards: []
}
]
};
function App() {
const [board, setBoard] = useState(initialBoard);
const handleCardMove = (cardId, fromColumnId, toColumnId, newIndex) => {
// Handle card movement logic
console.log('Card moved:', { cardId, fromColumnId, toColumnId, newIndex });
};
return (
<KanbanBoard
board={board}
onCardMove={handleCardMove}
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
board | KanbanBoardData | Required | The board data structure |
onCardMove | function | - | Called when a card is moved |
onCardUpdate | function | - | Called when a card is updated |
onCardDelete | function | - | Called when a card is deleted |
onCardCreate | function | - | Called when a card is created |
onColumnUpdate | function | - | Called when a column is updated |
theme | Partial<KanbanTheme> | defaultTheme | Theme customization |
className | string | '' | Additional CSS classes |
enableAnimations | boolean | true | Enable/disable animations |
enableDragAndDrop | boolean | true | Enable/disable drag and drop |
maxCardsPerColumn | number | - | Global max cards per column |
interface KanbanCard {
id: string;
title: string;
description?: string;
tags?: string[];
priority?: 'low' | 'medium' | 'high';
assignee?: string;
dueDate?: Date;
createdAt?: Date;
updatedAt?: Date;
customData?: Record<string, any>;
}
interface KanbanColumn {
id: string;
title: string;
cards: KanbanCard[];
maxCards?: number;
color?: string;
customData?: Record<string, any>;
}
interface KanbanTheme {
colors: {
primary: string;
secondary: string;
background: string;
cardBackground: string;
columnBackground: string;
text: string;
textSecondary: string;
border: string;
success: string;
warning: string;
danger: string;
};
borderRadius: string;
shadows: {
card: string;
column: string;
};
spacing: {
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
};
}
The library provides utility functions for common operations:
import {
addCard,
deleteCard,
moveCard,
updateCardInBoard,
updateColumn,
generateId,
} from 'react-kanban-component';
// Add a new card
const newBoard = addCard(board, 'column-id', {
title: 'New Task',
description: 'Task description'
});
// Move a card between columns
const movedBoard = moveCard(board, 'card-id', 'from-column', 'to-column', 0);
// Delete a card
const updatedBoard = deleteCard(board, 'card-id', 'column-id');
// Update a card
const modifiedBoard = updateCardInBoard(board, 'card-id', {
title: 'Updated Title'
});
import { darkTheme, colorfulTheme, defaultTheme } from 'react-kanban-component';
<KanbanBoard board={board} theme={darkTheme} />
const customTheme = {
colors: {
primary: '#your-color',
background: '#your-bg-color',
// ... other color overrides
}
};
<KanbanBoard board={board} theme={customTheme} />
function MyKanbanBoard() {
const [board, setBoard] = useState(initialBoard);
const handleCardMove = (cardId, fromColumnId, toColumnId, newIndex) => {
const newBoard = moveCard(board, cardId, fromColumnId, toColumnId, newIndex);
setBoard(newBoard);
// Optional: sync with backend
syncWithBackend(newBoard);
};
const handleCardUpdate = (cardId, updates) => {
const newBoard = updateCardInBoard(board, cardId, updates);
setBoard(newBoard);
};
const handleCardDelete = (cardId, columnId) => {
const newBoard = deleteCard(board, cardId, columnId);
setBoard(newBoard);
};
const handleCardCreate = (columnId, cardData) => {
const newBoard = addCard(board, columnId, cardData);
setBoard(newBoard);
};
return (
<KanbanBoard
board={board}
onCardMove={handleCardMove}
onCardUpdate={handleCardUpdate}
onCardDelete={handleCardDelete}
onCardCreate={handleCardCreate}
/>
);
}
import { CardComponentProps, ColumnComponentProps } from 'react-kanban-component';
const CustomCard: React.FC<CardComponentProps> = ({ card, theme }) => (
<div style={{ backgroundColor: theme.colors.cardBackground }}>
<h3>{card.title}</h3>
{/* Your custom card content */}
</div>
);
<KanbanBoard
board={board}
cardComponent={CustomCard}
/>
The component uses TailwindCSS classes internally but can be styled with any CSS framework. The theme system provides comprehensive customization options.
For additional customization, you can override CSS variables:
.kanban-board {
--kanban-primary: #3b82f6;
--kanban-secondary: #6b7280;
--kanban-background: #f8fafc;
}
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)MIT © NabeelAhmed23
FAQs
A fully customizable, animated kanban board component for React with TypeScript and TailwindCSS
We found that react-kanban-component demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.