Introduction

This project was highly influenced by and based on Shadcn/ui, Tailwind UI and Build UI.
The rise in popularity of copy-pasteable code to build your own libraries is undeniable. These new tools helped us ship and iterate features faster than ever. However, a key area I found was lacking full customizability were charts. That's why I developed (and actively use!) rosen/charts — to bring the same level of productivity gains to data visualization.

Why choose rosen over other charts?

For three main reasons:

  1. Server-side rendering: SSR is supported out of the box! Currently, these are the only charts with RSC support - no "use client" directive required until you need interactivity.
  2. Customization: These charts are as customizable as you need them to be. Instead of importing something like a <ResponsivePieChart> component and trying to figure out the API to change the color of the slices, you have direct access to the underlying divs and svgs.
  3. Copy-paste: Explore our curated library of charts and copy/paste the source code into your projects - or create your own versions.

Note: Out of the box, these charts support SSR/RSC, dark mode, tailwind, container queries and more.
Even though rendering charts on the server has a lot of benefits (bundle size, speed, no layout shifts, SEO, and more!) - it's totally possible and easy to add client interactivity (e.g. tooltips) as you progress. Under the hood, we simply use D3's functions to handle the math, and everything else consists of elements like divs and svgs that you can directly manipulate as needed.

FAQ

What does copy-pasteable mean?

Just like shadcn/UI and TailwindUI components, these charts aren't packaged in npm. You can simply copy and paste the source code into your projects and adapt to your needs.

Besides D3, do I really need Tailwind / ShadcnUI / Nextjs / XYZ

Nope, this will work on the simplest of React apps with plain css.

Which frameworks do you support?

For now, only React DOM frameworks are supported. This means Next, Remix, Astro, Vite, etc.

Vue and Nuxt support is currently under development.

What about HTMX and SuperFramework69?

Since D3 is just javascript and our charts are basically just html and svgs, I don't see why you couln't port it to any framework of your choice. If you do so, please let me know so I can showcase it here :)

Guides

Line Charts

Learn how to customize and animate your line charts in this section.

Pie Charts

If you work at McKinsey and want to keep your job, you should probably ignore this section.

Bar Charts

Learn how to customize and animate your bar charts in this section.

Area Charts

Learn how to customize and animate area charts in this section.