Twigs Charts

Getting Started

Getting started with Twigs Charts

Twigs Charts is a React component library from SurveySparrow for building charts. It is built on top of Recharts and provides a set of components for building charts.

Installation

npm install @sparrowengg/twigs-charts
yarn add @sparrowengg/twigs-charts
pnpm add @sparrowengg/twigs-charts

Make sure these peer dependencies are installed in your project:

npm install @sparrowengg/twigs-react recharts
yarn add @sparrowengg/twigs-react recharts
pnpm add @sparrowengg/twigs-react recharts

Usage

The package provides a ThemeProvider component that can be used to provide a theme to the charts, it should be wrapped around a top level component in your application.

import { ThemeProvider  } from "@sparrowengg/twigs-charts";

<ThemeProvider
  theme={{
    fontFamily: "DM Sans",
    fontFamilyAlternate: "DM Mono",
    colors: {
      primary: "#7158F5",
      list: [
        "#7158F5",
        "#EE7D61",
        "#98E0D8",
        "#EFBE55",
        "#84CC16",
      ],
    }
  }}
>
  <Charts />
</ThemeProvider>

On this page