Contributing
This page is for developing React Native Chart Kit itself. If you are installing the library in an app, start with the Quickstart.
Repository Setup
cd react-native-chart-kitnpm installThe repository uses npm workspaces and package-lock.json.
App developers install this package:
react-native-chart-kit: the public npm package.
This repository also has internal workspaces:
@chart-kit/core: shared chart logic, types, scales, and data helpers.@chart-kit/svg-renderer: SVG primitives and renderer helpers used by the React Native charts.@chart-kit/react-native: the React Native implementation of the modern charts. It is assembled intoreact-native-chart-kit/v2.@chart-kit/site: the docs site and live chart previews.
Local Checks
Run the focused check for the area you changed, then run the broader checks before opening a pull request.
npm run lintnpm run typechecknpm run testnpm run docs:buildnpm run buildUseful focused commands:
| Command | Purpose |
|---|---|
npm run core:typecheck | Type-check the core workspace. |
npm run svg:typecheck | Type-check the SVG renderer workspace. |
npm run rn:typecheck | Type-check the chart library’s React Native implementation and its tests. |
npm run test:unit | Run unit tests. |
npm run test:compat | Check that old v6-style chart data still normalizes correctly. |
npm run example:rn-cli:typecheck | Type-check the small non-Expo example app against react-native-chart-kit/v2. |
npm run docs:build | Verify docs links and type-check documentation examples. |
npm run pack:check | Dry-run the npm packages and confirm required files are included. |
npm run surface:check | Check public exports and make sure free packages do not import Pro or Skia code. |
Example App
The public repo includes a small React Native CLI example app:
npm run example:rn-cli:typecheckUse it to check that a plain non-Expo app can import
react-native-chart-kit/v2 and pass valid props to the chart components.
The example app lives in examples/rn-cli-basic:
App.tsx: the example screen with a few charts.metro.config.js: Metro aliases that point package imports back to this repo’s local source files.
Branch Names
Use lowercase kebab-case branch names in this format:
<type>/<short-summary>Use these branch types:
fix/for user-visible bug fixesfeat/for new public functionalitydocs/for documentation-only changesci/for automation and CI changeschore/for maintenance, release hygiene, and dependency upkeeprefactor/for internal changes that do not intentionally change behaviorrelease/for version bump and publishing prep
Include an issue number when the branch maps to a specific issue, for example
fix/733-svg-gradient-ids. Keep each branch scoped to one pull request.