Getting Started with React Progress Bar Component
23 Jul 20265 minutes to read
This section explains the steps required to create the Progress Bar component using React and configure its properties.
Prerequisites
Before getting started, ensure you have:
- Node.js version 14 or later installed
- React 16 or later (React 18+ recommended for
createRoot)
Dependencies
Below is the list of minimum dependencies required to use the Progress Bar component.
|-- @syncfusion/ej2-react-progressbar
|-- @syncfusion/ej2-base
|-- @syncfusion/ej2-data
|-- @syncfusion/ej2-svg-baseThese dependencies will be installed automatically when you install the main package.
Installation and Configuration
To easily set up a React application, use the Vite CLI (npm create vite), which provides a faster development environment, smaller bundle sizes, and optimized builds compared to traditional tools like create-react-app. For detailed steps, refer to the Vite installation instructions. Vite sets up your environment using JavaScript and optimizes your application for production.
Note: To create a React application using
create-react-appinstead, refer to this documentation for more details.
To create a new React application, run the following command.
npm create vite@latest my-appThis command will prompt you for a few settings for the new project, such as selecting a framework and a variant.

To set up a React application in a TypeScript environment, run the following command.
npm create vite@latest my-app -- --template react-ts
cd my-app
npm run devTo set up a React application in a JavaScript environment, run the following command.
npm create vite@latest my-app -- --template react
cd my-app
npm run devInstall Syncfusion® Progress Bar Package
All the available Essential® JS 2 packages are published in the npmjs.com public registry.
To install the Syncfusion® Progress Bar package, use the following command.
npm install @syncfusion/ej2-react-progressbarAdd the Progress Bar Component
Now you can add the Progress Bar component to your application. Update the src/App.tsx (or src/App.jsx) file with the following code to create a basic linear Progress Bar.
TypeScript (src/App.tsx):
import { ProgressBarComponent } from '@syncfusion/ej2-react-progressbar';
import * as React from 'react';
function App() {
return (
<ProgressBarComponent id="linear" type="Linear" value={40} />
)
}
export default App;Ensure src/main.tsx contains the following code to render the component into <div id="root"> defined in index.html.
TypeScript (src/main.tsx):
import { createRoot } from 'react-dom/client';
import * as React from 'react';
import App from './App';
createRoot(document.getElementById('root')!).render(<App />);JavaScript (src/App.jsx):
import { ProgressBarComponent } from '@syncfusion/ej2-react-progressbar';
import * as React from 'react';
function App() {
return (
<ProgressBarComponent id="linear" type="Linear" value={40} />
)
}
export default App;
Run the Application
Run the following command to start the development server.
npm run devThis command compiles your code and serves the application locally, opening it in the browser.
Complete Code Example
The following demonstrates a complete implementation, including the entry file and the Progress Bar component.
import { ProgressBarComponent } from '@syncfusion/ej2-react-progressbar';
import * as React from "react";
import { createRoot } from 'react-dom/client';
function App() {
return (<ProgressBarComponent id="linear" type='Linear' height='60' value={40} animation=>
</ProgressBarComponent>);
}
export default App;
const root = createRoot(document.getElementById('container'));
root.render(<App />);import { ProgressBarComponent } from '@syncfusion/ej2-react-progressbar';
import * as React from "react";
import { createRoot } from 'react-dom/client';
function App() {
return(<ProgressBarComponent id="linear"
type='Linear'
height='60'
value={40}
animation=>
</ProgressBarComponent>
)
};
export default App;
const root = createRoot(document.getElementById('container')!);
root.render(<App />);Troubleshooting
Common issues and fixes:
-
createRootis not a function – Your React version is older than 18. Upgrade React andreact-domto v18+, or use the legacyReactDOM.renderAPI. -
Port already in use – Vite will prompt to use an alternative port, or run
npm run dev -- --port 3000. -
Module not found for
@syncfusion/ej2-react-progressbar– Verify the package is listed inpackage.jsondependencies and re-runnpm install.