This is a quickstart tutorial for using vtk.js with React.
Initialize your project
Use npx create-react-app my-vtkjs-app, yarn create react-app my-vtkjs-app, or npm init react-app to initialize your project. For this tutorial, we will use yarn.
$ yarn create react-app my-vtkjs-app $ cd my-vtkjs-app $ ls node_modules/ package.json public/ README.md src/ yarn.lock
Now install vtk.js as a dependency.
$ yarn add @kitware/vtk.js
Using vtk.js in your app
To add a minimal vtk.js example to your app, replace src/App.js with the following contents.
You can run the app using the project’s built-in dev server.
$ yarn start
Navigate to http://localhost:3000, and you should have an interactive 3D visualization of a cone, similar to the SimpleCone example.
Where to go next
Check out the tutorials, or if you know what you want but need API docs, check out the API.