plotly
react-plotly.js
JavaScript

A plotly.js React component from Plotly ๐Ÿ“ˆ

Last updated Jul 5, 2026
1.1k
Stars
138
Forks
142
Issues
+1
Stars/day
Attention Score
97
Language breakdown
JavaScript 100.0%
โ–ธ Files click to expand
README

react-plotly.js

plotly-react-logo

A plotly.js React component from
Plotly.

Maintained by Plotly


Contents

- Basic props - Event handler props - Responsive plot - Event handlers - TypeScript - Grabbing the graph div via ref

<pre><code class="lang-">React is pinned to 18 here because React 19 stopped shipping UMD builds; consumers wanting React 19 should load it via [importmap or use a bundler.

The factory is exposed as the global createPlotlyComponent. Build the component and mount it:</code></pre>javascript const Plot = createPlotlyComponent(Plotly); const root = ReactDOM.createRoot(document.getElementById('root')); root.render( React.createElement(Plot, { data: [{x: [1, 2, 3], y: [2, 1, 3]}], }) ); <pre><code class="lang-">## Development

To get started:</code></pre>bash $ npm install <pre><code class="lang-">To build the published artifacts (dist/index.{mjs,cjs}, dist/factory.{mjs,cjs}, the UMD bundle, and the declaration files) via tsup:</code></pre>bash $ npm run build <pre><code class="lang-">To run lint + typecheck + jest:</code></pre>bash $ npm run test <pre><code class="lang-">To watch source files and rebuild on change:</code></pre>bash $ npm run watch `

Releases are cut from main per the steps in RELEASE.md`.

License

© 2017-2026 Plotly, Inc. MIT License.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท plotly/react-plotly.js ยท Updated daily from GitHub