Nivo charts Documentation Explained: Props, Themes and Data Formats

Nivo charts documentation style props table for ResponsiveBar beside a live bar chart preview

Nivo charts documentation is published on the nivo.rocks website and is one of the most hands-on documentation sites among React chart libraries. Instead of static pages alone, each chart comes with live controls, editable sample data and generated code. Knowing how the pages are structured helps you find the right prop or data format in seconds rather than minutes.

How the Documentation Site Is Organised

The home page of nivo.rocks lists every chart type as a visual card. Selecting a chart opens its dedicated page, and most charts provide sub-pages for each renderer, such as SVG, Canvas or HTML, alongside any special variants. The navigation stays consistent across charts, so once you learn one page you can read them all.

Beyond chart pages, the site includes guides for shared topics like theming, colours, legends, gradients and patterns. A link to the project Storybook offers extra stories that cover edge cases and less common configurations.

Reading a Chart Page

Each chart page is split into a preview area and a configuration area. The preview renders the chart with the current settings, and tabs let you switch between the chart, its generated code and the sample data feeding it. Changing a control instantly updates all three views.

  • Chart tab: the live, interactive preview.
  • Code tab: the JSX that reproduces the current configuration.
  • Data tab: the sample data in the exact shape the chart expects.
  • Controls panel: grouped settings for base options, style, labels, grid, axes, interactivity and motion.

Understanding Prop Tables

Below or beside the controls, each chart lists its properties with the type, whether the prop is required and the default value. Many entries include a short description and, where useful, links to related guides such as colour handling or theming.

Reading the type column carefully avoids many mistakes. A prop typed as a string or function, for example, can accept either a field name or a callback, which opens up flexible patterns like computing labels or colours from each datum.

ColumnWhat it tells you
Prop nameThe exact name to use in JSX
TypeAccepted value shapes, such as number, object or function
RequiredWhether the chart fails without it
DefaultThe value used when you omit the prop

Finding the Right Data Format

The data tab is the most reliable reference for data shapes. Copying the sample, confirming the chart renders and then replacing values with your own is a dependable way to avoid format errors. Field names in the sample often correspond to props such as indexBy or keys, so changing one usually means updating the other.

Hierarchical charts like treemap, sunburst and circle packing expect a single root object with nested children, while series charts like line and scatter plot expect arrays of series. Recognising these families makes new chart types easier to learn.

Using the Generated Code Effectively

The code tab is more than a convenience. Adjusting the controls until the preview looks right, then copying the generated JSX, gives a working starting point that already includes margins, axes, legends and colours.

Treat that snippet as a draft rather than final code. Move repeated settings, especially themes and colours, into shared constants so every chart in your application stays consistent and easier to maintain.

Theming and Shared Guides

The theming guide documents the structure of the theme object, including text, axis, grid, legends, labels, annotations and tooltip sections. Because all charts read from the same structure, a theme defined once can style an entire dashboard.

Other shared guides cover colour schemes, which come from d3-scale-chromatic, along with gradients and patterns that can be applied through defs and fill props. These guides are worth reading once, since the concepts apply across most chart types.

Accessibility Props

Several charts document accessibility props such as role, ariaLabel, ariaLabelledBy and ariaDescribedBy. Checking each chart page for these options helps you provide meaningful labels for screen reader users.

When the Documentation Is Not Enough

Occasionally a question goes beyond what the pages cover, such as unusual combinations of features or behaviour after an upgrade. The GitHub repository is the next stop, where existing issues, discussions and release notes often contain the answer.

Reading the component source in the packages folder is also surprisingly approachable, because each chart lives in its own clearly named package. The GitHub repository article explains how that structure works.

A Practical Workflow for Reading the Docs

Developers who use the site efficiently tend to follow the same routine. They start with the chart page, confirm the data shape, experiment with controls, then read only the props they actually changed.

  • Open the chart page that matches your data and question.
  • Copy the sample from the data tab and render it in your project.
  • Adjust controls until the preview matches your design.
  • Copy the generated code and replace sample data with real data.
  • Look up any unfamiliar props in the properties list.

Following this sequence keeps the learning focused on what your chart needs, rather than every option the library offers.

Keeping Up with Documentation Changes

The documentation tracks the latest release, so props described on the site may not exist in an older version installed in your project. When something does not behave as documented, compare your installed version with the release notes before assuming a bug.

Frequently Asked Questions

Is the Nivo documentation available offline?

The documentation website source lives in the GitHub repository, so it can be run locally by following the contributing instructions there.

Does the documentation show TypeScript types?

Prop tables describe value types, and the packages ship TypeScript definitions that editors display while you type.

Which page should beginners read first?

Start with the bar or line chart page, explore the controls and data tab, then read the theming guide.

Conclusion

Nivo charts documentation combines live previews, generated code, sample data and detailed prop tables in one place. Using the data tab for shapes, the controls for experimentation and the shared guides for theming makes the site a practical everyday tool.

When questions go deeper, the GitHub repository and its issues fill the gaps. Pair this approach with the installation steps to move from reading to building quickly.