Thanks for taking the time to contribute! This guide covers everything you need to get productive quickly.
- 🐞 Report a bug — open an issue with the Bug report form (a minimal reproduction helps the most).
- ✨ Request a feature — use the Feature request form.
- 📖 Improve the docs — the documentation site lives in
example/. - 🔧 Fix something — see the workflow below.
src/
core/ headless logic — useCarousel, reducer, autoplay/keyboard/swipe hooks
components/ compound parts — Carousel.Track / Slide / Button / Dots / PlayPause
context/ CarouselContext
presets/ ready-made sliders — CardSlider, ImageSlider, SlicerSlider
styles/ bundled base CSS
example/ the documentation site (Parcel)
scripts/ release tooling
Requires Node 18+.
git clone https://github.com/droidbg/react-carousel.git
cd react-carousel
npm install
npm run build # build the library (dual ESM/CJS + types)
npm run dev # rebuild on change
npm run example # run the docs site at http://localhost:1234npm test # typecheck + build (this is what CI runs)
npm run lint # eslint- Keep changes focused; one logical change per PR.
- Match the surrounding code style (TypeScript, no semicolon-free surprises — follow the existing files).
- The library ships framework-free CSS — don't introduce Tailwind or other style dependencies into
src/. - New public API needs types and a short doc entry in
example/where relevant. - Update
CHANGELOG.mdunder an## [Unreleased]heading.
- Fork and create a branch off
main(e.g.feat/vertical-orientation). - Make your change; ensure
npm testandnpm run lintpass. - Open a PR against
mainwith a clear description of what and why. - A maintainer will review; please be responsive to feedback.
Use clear, imperative summaries (e.g. Add fade transition to Carousel). Conventional Commit prefixes (feat:, fix:, docs:) are welcome but not required.
Maintainers cut releases with npm run release (interactive: beta / stable / custom → npm publish + git tag + GitHub release).
By contributing, you agree that your contributions are licensed under the project's Apache License.