Integrating Orbit with React is simple and can be done in two scenarios: browser-based and Node.js-based projects. Below, you’ll find step-by-step instructions for both.
1. Browser-Based integration
If you’re using React directly in the browser, follow these steps:
Import Orbit files
Add the Orbit CSS and JavaScript files to your HTML file using a CDN. Include React and Babel for JSX support if needed:
Use Orbit components
Orbit web-components(o-arc, o-progress) are automatically recognized in the browser. You can use them directly in your React code:
2. Node.js-Based integration
If you’re using React in a Node.js environment (e.g., with Create React App or Vite), follow these steps:
Import Orbit files
Install Orbit via npm
Configure React to mount Orbit web components
One way to ensure React recognizes Orbit web components (o-arc, o-progress) is to include them in a script tag.