PitchKit

Introduction

What PitchKit is, and how the pieces fit together.

PitchKit is a TypeScript-native football pitch visualisation library for the web — mplsoccer's surface, built for the browser. @pitchkit/core is a framework-agnostic engine (coordinate transforms, SVG + Canvas rendering); @pitchkit/react is the officially supported set of declarative bindings on top of it, split into two families: components (the pitch itself) and overlays (data plotted onto it).

Install

npm install @pitchkit/core @pitchkit/react

Quickstart

"use client";

import { Pitch, Scatter } from "@pitchkit/react";

const shots = [
  { x: 108, y: 38, xg: 0.62 },
  { x: 96, y: 48, xg: 0.15 },
];

export function ShotMap() {
  return (
    <Pitch type="statsbomb">
      <Scatter data={shots} x={(s) => s.x} y={(s) => s.y} r={(s) => 3 + s.xg * 9} />
    </Pitch>
  );
}

That's a responsive, server-renderable shot map. Every layer takes plain data plus accessor functions for its visual properties — x, y, and most other props accept either a static value or a per-datum function, which is how PitchKit stays shape-agnostic across providers (StatsBomb, Opta, UEFA, or your own).

Finding your way around

On this page