Bug Reports | Feature Requests | Pull Requests | Development Setup | Running Tests
Thank you for considering contributing to React Split Pane! Please take a moment to review this document to make the contribution process easy and effective.
The issue tracker is the preferred channel for bug reports and feature requests. Please respect these guidelines:
- Do not use the issue tracker for personal support requests.
- Do not derail or troll issues. Keep discussions on topic.
A bug is a demonstrable problem caused by the code in the repository. Good bug reports are extremely helpful!
Guidelines for bug reports:
- Search first — Check if the issue has already been reported.
- Test latest — Try to reproduce it using the latest
masterbranch. - Isolate — Create a minimal reproduction using CodeSandbox or StackBlitz.
A good bug report includes:
- React Split Pane version
- React version
- Browser and OS
- Steps to reproduce
- Expected vs actual behavior
- Link to reproduction
Feature requests are welcome! Please provide:
- Clear use case
- Why existing features don't solve your problem
- API suggestions (if applicable)
- Examples from similar libraries (if applicable)
Good pull requests are a fantastic help! They should remain focused and avoid unrelated changes.
Please ask first before starting significant work (new features, major refactoring). Open an issue to discuss your idea.
-
Fork and clone the repository:
git clone https://github.com/<your-username>/react-split-pane cd react-split-pane git remote add upstream https://github.com/tomkp/react-split-pane
-
Create a branch from
master:git checkout master git pull upstream master git checkout -b my-feature
-
Install dependencies:
npm install
-
Make your changes, following the code style.
-
Add tests for new functionality.
-
Ensure all tests pass:
npm test -
Ensure code passes linting:
npm run lint
-
Commit with a clear message:
git commit -m "feat: add new feature" -
Push and open a pull request against
master:git push origin my-feature
We follow Conventional Commits:
feat:— New featurefix:— Bug fixdocs:— Documentation onlystyle:— Formatting, no code changerefactor:— Code change that neither fixes a bug nor adds a featuretest:— Adding or fixing testschore:— Build process or auxiliary tools
- Node.js 20+
- npm 9+
# Clone the repository
git clone https://github.com/tomkp/react-split-pane
cd react-split-pane
# Install dependencies
npm install
# Start the development server (examples)
npm run devThe examples will be available at http://localhost:5173
src/
├── components/ # React components (SplitPane, Pane, Divider)
├── hooks/ # React hooks (useResizer, useKeyboardResize)
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
├── test/ # Test setup
└── index.ts # Main entry point
examples/ # Example applications
| Command | Description |
|---|---|
npm run dev |
Start examples dev server |
npm test |
Run tests |
npm run test:watch |
Run tests in watch mode |
npm run lint |
Run ESLint |
npm run build |
Build for production |
npm run typecheck |
Run TypeScript type checking |
All tests must pass before a pull request will be merged.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage- Place tests next to the code they test (e.g.,
useResizer.test.ts) - Use descriptive test names
- Test both success and error cases
- For hooks, use
@testing-library/reactandrenderHook
Example:
import { describe, it, expect } from 'vitest';
import { renderHook } from '@testing-library/react';
import { useResizer } from './useResizer';
describe('useResizer', () => {
it('initializes with provided sizes', () => {
const { result } = renderHook(() =>
useResizer({
direction: 'horizontal',
sizes: [300, 700],
minSizes: [100, 100],
maxSizes: [500, 900],
})
);
expect(result.current.currentSizes).toEqual([300, 700]);
});
});- TypeScript — All code must be typed
- ESLint — Run
npm run lintbefore committing - Prettier — Code is auto-formatted
- No
any— Avoidanytypes; useunknownif necessary - Functional — Prefer functional components and hooks
- Comments — Add JSDoc comments to exported functions
import type { CSSProperties } from 'react';
interface MyComponentProps {
/** Description of the prop */
value: string;
/** Optional prop with default */
size?: number;
}
/**
* Description of the component.
*
* @example
* ```tsx
* <MyComponent value="hello" />
* ```
*/
export function MyComponent({ value, size = 10 }: MyComponentProps) {
// Implementation
}By contributing, you agree to license your work under the MIT License.