React ProgressBar - Overview

The ProgressBar is a UI component that shows current progress.

View Demo

The following code adds a simple ProgressBar to your page. The value property specifies the current value. The min and max properties limit the range of accepted values. The progress is measured in percentages and calculated by the following formula: (value / max) * 100. If the current progress is unknown yet, set the value property to false.

  • import React from 'react';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { ProgressBar } from 'devextreme-react/progress-bar';
  •  
  • class App extends React.Component {
  • constructor(props) {
  • super(props);
  • }
  •  
  • render() {
  • return (
  • <ProgressBar
  • min={0}
  • max={100}
  • value={49}
  • />
  • );
  • }
  • }
  •  
  • export default App;

When the ProgressBar reaches the maximum value, the complete event is raised. You can handle it using the onComplete function.

  • import React from 'react';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { ProgressBar } from 'devextreme-react/progress-bar';
  • import { alert } from "devextreme/ui/dialog";
  •  
  • class App extends React.Component {
  • constructor(props) {
  • super(props);
  • }
  •  
  • onComplete() {
  • alert('Completed');
  • }
  •  
  • render() {
  • return (
  • <ProgressBar
  • min={0}
  • max={100}
  • value={49}
  • onComplete={this.onComplete}
  • />
  • );
  • }
  • }
  •  
  • export default App;
See Also