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

universal-adaptive-bars

v0.0.6

Published

A highly customizable smart bar chart for React and React Native

Downloads

81

Readme

Universal Adaptive Bars 📊

A highly customizable, interactive, and drill-down capable Bar Chart library for React and React Native.

License Version

📖 Read the Story: Universal Adaptive Bars: The Smart Cross-Platform Charting Library You’ve Been Waiting For

New in v0.0.6 🚀

  • Calendar Jump: Selecting a date in the calendar now "jumps" to that date (scrolling the view) instead of filtering data, preserving your ability to navigate back and forth.
  • Smart Stacked Radius: Stacked bars now intelligently apply rounded corners only to the top and bottom segments for a polished UI.
  • Improved Alignment: Perfect X-axis alignment for both standard and stacked bars.

Features

  • 📅 Time-based Drill Down: Navigate seamlessly continuously from Year -> Month -> Week -> Day.
  • 🎨 Deep Customization: Full control over colors, grid, axis, and bar styling via the theme prop.
  • 📱 React Native Support: First-class support for Mobile via react-native-svg.
  • 🥞 Stacked Bars: Support for multi-value data keys (Histogram style).
  • Accessible: ARIA support for Web and Accessibility Props for Native.
  • 🤖 AI Ready: Integrated interfaces for predictive analytics.

Installation

npm install universal-adaptive-bars date-fns d3-scale clsx tailwind-merge
# Peer Dependencies for React Native
# npm install react-native-svg

Usage (Web)

import { SmartBarChart, DataPoint } from 'smart-bar-chart';

const data = [
  { date: '2023-01-01', value: 100, label: 'Jan' },
  { date: '2023-02-01', value: 200, label: 'Feb' },
  // ...
];

function App() {
  return (
    <SmartBarChart
      data={data}
      view="month"
      dataKeys={{ label: 'label', value: 'value', date: 'date' }}
      axisLabels={{ x: 'Date', y: 'Revenue' }}
      height={400}
      theme={{
          background: '#fff',
          bar: { radius: 4, opacity: 1 },
          grid: { stroke: '#eee', visible: true }
      }}
    />
  );
}

Usage (React Native)

import { SmartBarChartNative } from 'smart-bar-chart/native';

// ... usage is identical to Web component
<SmartBarChartNative
  data={data}
  view="month"
  dataKeys={{ label: 'label', value: 'value', date: 'date' }}
/>

Props

| Prop | Type | Description | |------|------|-------------| | data | RawDataPoint[] | Array of data objects. | | view | 'day' \| 'week' \| 'month' \| 'year' | Initial aggregation level. | | dataKeys | { label: string, value: string \| string[], date: string } | Keys to map data fields. | | theme | ChartTheme | Custom styling object. | | onViewChange | (view: ChartView) => void | Callback when drill-down occurs. | | geminiConfig | { apiKey: string, model: string } | Configuration for AI predictions. |

Customization (Theme)

The theme prop allows you to override default styles:

interface ChartTheme {
    background?: string;
    bar?: {
        radius?: number;
        opacity?: number;
        maxWidth?: number;
    };
    grid?: {
        stroke?: string;
        strokeDasharray?: string;
        visible?: boolean;
    };
    axis?: {
        labelColor?: string;
        tickColor?: string;
        fontSize?: number;
    };
}

Accessibility

  • Web: Main chart has role="img" and proper ARIA labels. Bars are interactive.
  • Native: Elements support accessibilityLabel and accessibilityHint compatible with TalkBack and VoiceOver.

Built with ❤️ using React & D3.