Skip to content

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

Terminal window
git clone [email protected]:chart-kit/react-native-chart-kit.git
cd react-native-chart-kit
npm install

The 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 into react-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.

Terminal window
npm run lint
npm run typecheck
npm run test
npm run docs:build
npm run build

Useful focused commands:

CommandPurpose
npm run core:typecheckType-check the core workspace.
npm run svg:typecheckType-check the SVG renderer workspace.
npm run rn:typecheckType-check the chart library’s React Native implementation and its tests.
npm run test:unitRun unit tests.
npm run test:compatCheck that old v6-style chart data still normalizes correctly.
npm run example:rn-cli:typecheckType-check the small non-Expo example app against react-native-chart-kit/v2.
npm run docs:buildVerify docs links and type-check documentation examples.
npm run pack:checkDry-run the npm packages and confirm required files are included.
npm run surface:checkCheck 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:

Terminal window
npm run example:rn-cli:typecheck

Use 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:

Terminal window
<type>/<short-summary>

Use these branch types:

  • fix/ for user-visible bug fixes
  • feat/ for new public functionality
  • docs/ for documentation-only changes
  • ci/ for automation and CI changes
  • chore/ for maintenance, release hygiene, and dependency upkeep
  • refactor/ for internal changes that do not intentionally change behavior
  • release/ 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.