Thank you for your interest in contributing! This guide will help you get started.
- Node.js >= 18
- npm >= 9
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/<your-username>/react-table-dnd.git cd react-table-dnd
- Install dependencies:
npm install
- Start the dev server:
npm run dev
Create a branch from main using one of these prefixes:
| Prefix | Use for |
|---|---|
feat/ |
New features |
fix/ |
Bug fixes |
refactor/ |
Code refactoring |
docs/ |
Documentation changes |
chore/ |
Tooling, CI, dependency updates |
Example: feat/virtual-scroll-improvements
We follow Conventional Commits:
<type>(<scope>): <short description>
[optional body]
[optional footer]
Types: feat, fix, refactor, docs, chore, test, perf, style
Examples:
feat(drag): add horizontal auto-scroll supportfix(column): prevent drag outside container boundsdocs: update README with virtual scroll example
- Code is auto-formatted with Prettier on commit via Husky + lint-staged
- Run
npm run formatto format all files manually - Run
npm run lintto check for linting errors - Run
npm run format:checkto verify formatting without writing
- Create your feature branch:
git checkout -b feat/my-feature - Make your changes
- Ensure your code is formatted:
npm run format - Ensure linting passes:
npm run lint - Build the library to check for errors:
npm run build - Commit your changes following the commit convention above
- Push to your fork:
git push origin feat/my-feature - Open a Pull Request against
main
- Fill out the PR template completely
- Keep PRs focused — one feature or fix per PR
- Update
CHANGELOG.mdfor user-facing changes - Ensure CI checks pass
- Be responsive to review feedback
Use the Bug Report template. Include:
- Steps to reproduce
- Expected vs actual behavior
- A minimal reproduction (CodeSandbox/StackBlitz link is ideal)
Use the Feature Request template. Describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
src/
├── Components/ # Core table components
│ ├── TableContainer/ # Main container + useTable hook
│ ├── TableHeader.tsx # Header row
│ ├── TableBody.tsx # Body rows
│ ├── BodyRow.tsx # Individual row
│ ├── ColumnCell.tsx # Header cell
│ ├── RowCell.tsx # Body cell
│ ├── Draggable.tsx # Drag wrapper
│ ├── DragHandle.tsx # Drag handle component
│ └── index.ts # Public exports
├── hooks/ # Custom hooks
│ ├── useAutoScroll.ts
│ ├── useDragContextEvents.tsx
│ └── useLongPress.ts
└── examples/ # Demo examples (docs site)
By contributing, you agree that your contributions will be licensed under the MIT License.