React LoadIndicator - Overview

The LoadIndicator is a UI element notifying the viewer that a process is in progress.

View Demo

The following code adds a simple LoadIndicator to your page. You can change the UI component size, using the height and width properties.

Code
  • import React, { useState } from 'react';
  • import 'devextreme/dist/css/dx.fluent.blue.light.css';
  •  
  • import { LoadIndicator } from 'devextreme-react/load-indicator';
  •  
  • function App() {
  • const isLoadIndicatorVisible = true;
  • return (
  • <LoadIndicator
  • visible={isLoadIndicatorVisible}
  • height={40}
  • width={40}
  • />
  • );
  • }
  •  
  • export default App;

If you need to use a custom image in the LoadIndicator, assign its URL to the indicatorSrc property.

Code
  • import React, { useState } from 'react';
  • import 'devextreme/dist/css/dx.fluent.blue.light.css';
  •  
  • import { LoadIndicator } from 'devextreme-react/load-indicator';
  •  
  • const indicatorUrl = 'https://js.devexpress.com/Content/data/loadingIcons/rolling.svg';
  •  
  • function App() {
  • const [isLoadIndicatorVisible] = useState(true);
  •  
  • return (
  • <LoadIndicator
  • visible={isLoadIndicatorVisible}
  • indicatorSrc={indicatorUrl}
  • />
  • );
  • }
  •  
  • export default App;
See Also