npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-billboard

v0.0.3

Published

Billboard is a React component library that provides a declarative, component-based API for creating charts using Recharts. It offers both a props-based and component-based approach, making it flexible for different usage patterns while maintaining a cons

Downloads

11

Readme

Billboard Chart Library

Billboard is a React component library that provides a declarative, component-based API for creating charts using Recharts. It offers both a props-based and component-based approach, making it flexible for different usage patterns while maintaining a consistent API.

Installation

npm install react-billboard

Usage Examples

Props-based Approach

import { Billboard } from 'react-billboard';

const MyChart = () => (
  <Billboard 
    type="line"
    datasets={[{
      name: "Revenue",
      data: [
        { x: "Jan", y: 1000 },
        { x: "Feb", y: 1500 },
        { x: "Mar", y: 1200 }
      ],
      color: "#4299E1",
      style: {
        strokeWidth: 2,
        dot: true,
      }
    }]}
  >
    <Billboard.Chart className="h-[400px]" />
  </Billboard>
);

Component-based Approach

const MyComponentChart = () => (
  <Billboard type="line">
    <Billboard.Chart className="h-[400px]">
      <Billboard.Dataset 
        name="Revenue" 
        color="#4299E1"
        style={{
          strokeWidth: 2,
          dot: true,
        }}
      >
        <Billboard.Datapoint x="Jan" y={1000} />
        <Billboard.Datapoint x="Feb" y={1500} />
        <Billboard.Datapoint x="Mar" y={1200} />
      </Billboard.Dataset>
    </Billboard.Chart>
  </Billboard>
);

Area Chart with Multiple Datasets

const MyAreaChart = () => (
  <Billboard type="area">
    <Billboard.Chart className="h-[400px]">
      <Billboard.Dataset
        name="Revenue"
        color="#4299E1"
        style={{
          fillOpacity: 0.3,
          strokeWidth: 2,
        }}
        data={[
          { x: "Jan", y: 1000 },
          { x: "Feb", y: 1500 },
          { x: "Mar", y: 1200 }
        ]}
      />
      <Billboard.Dataset
        name="Profit"
        color="#48BB78"
        style={{
          fillOpacity: 0.3,
          strokeWidth: 2,
        }}
        data={[
          { x: "Jan", y: 300 },
          { x: "Feb", y: 450 },
          { x: "Mar", y: 350 }
        ]}
      />
    </Billboard.Chart>
  </Billboard>
);

Component API

<Billboard>

Main container component for creating charts.

Props

  • type (required): 'line' | 'area' | 'bar' | 'scatter' | 'pie'
  • datasets?: Array of dataset objects (for props-based usage)
  • className?: CSS class name
  • children?: React nodes

<Billboard.Chart>

Chart container component.

Props

  • className?: CSS class name (required for setting height)
  • x?: X-axis configuration
    {
      title?: string;
      min?: number;
      max?: number;
    }
  • y?: Y-axis configuration (same as x)
  • children?: Dataset components

<Billboard.Dataset>

Dataset container component.

Props

  • name: Dataset identifier
  • color?: Dataset color
  • data?: Array of data points
  • style?: Dataset styling options
    {
      strokeWidth?: number;
      fillOpacity?: number;
      dot?: boolean;
    }
  • children?: Datapoint components

<Billboard.Datapoint>

Individual data point component. Must be a child of Dataset.

Props

  • x: X value (string | number)
  • y: Y value (number)
  • color?: Point color
  • style?: Point-specific styling

TypeScript Types

type ChartType = 'line' | 'area' | 'bar' | 'scatter' | 'pie';

interface DataPoint {
  x: string | number;
  y: number;
  color?: string;
}

interface DatasetStyle {
  strokeWidth?: number;
  fillOpacity?: number;
  dot?: boolean;
}

interface Dataset {
  name: string;
  data: DataPoint[];
  color?: string;
  style?: DatasetStyle;
}

Styling

The library uses Recharts under the hood and supports two types of styling:

  1. Container styling through className props
<Billboard.Chart className="h-[400px] w-full" />
  1. Chart-specific styling through the style prop
<Billboard.Dataset
  style={{
    strokeWidth: 2,
    fillOpacity: 0.3,
    dot: true
  }}
/>

Best Practices

  1. Always provide a fixed height via className on Billboard.Chart
  2. Use consistent colors across related datasets
  3. For area charts, use fillOpacity for better visualization
  4. When using Datapoints, always place them inside a Dataset
  5. Use meaningful names for datasets to populate the legend

Limitations

  1. The library currently supports basic chart types from Recharts
  2. Custom Recharts components must be added through the base Billboard props
  3. Some Recharts features require direct props configuration
  4. Animation options are inherited from Recharts defaults

Browser Support

Supports all modern browsers that support SVG and React.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT