How To Use Semantic UI Loader And Stepper In ReactJS

Introduction

 
In this article we will learn about semantic UI Loader and stepper. Semantic UI is a UI component framework for building resposive user interfaces. In previous articles we learned how to install semantic UI in React and basic components of Semantic UI.
 
You can check my previous articles from the below links,
Prerequisites
  • We should have a basic knowledge of HTML and ReactJS.
  • Visual Studio Code installed
  • Node and NPM installed
Step 1
 
Let's create a new React project by using the following command:
  1. npx create-react-app reduxapp  
Open this project in Visual Studio Code and install semantic UI using the following command. 
  1. npm install semantic-ui-react   
Now open index.js file and import semantic UI css.
  1. import 'semantic-ui-css/semantic.min.css'   
Now go to src folder and create a new component 'Loaderdemo.js'. Add the following code in this component:
  1. import React, { Component } from 'react'  
  2. import { Dimmer, Loader, Image, Segment } from 'semantic-ui-react'  
  3. export class Loaderdemo extends Component {  
  4.     render() {  
  5.         return (  
  6.             <div>  
  7.                 <div class="ui blue inverted three item menu">  
  8.                     <a class="item">Semantic UI Loader</a>  
  9.                 </div>  
  10.                 <Segment>  
  11.                     <Dimmer active>  
  12.                         <Loader />  
  13.                     </Dimmer>  
  14.                     <Image src='https://react.semantic-ui.com/images/wireframe/short-paragraph.png' />  
  15.                 </Segment>  
  16.             </div>  
  17.         )  
  18.     }  
  19. }  
  20.   
  21. export default Loaderdemo  
Add a reference of this component in app.js file
  1. import React from 'react';  
  2. import './App.css';  
  3. import Loaderdemo from './Loaderdemo'  
  4. function App() {  
  5.   return (  
  6.     <div className="App">  
  7.       <Loaderdemo/>  
  8.     </div>  
  9.   );  
  10. }  
  11.   
  12. export default App;  
Now, run the project by using 'npm start' command and check the result.
 
How To Use Semantic UI Loader And Stepper In ReactJS
Now go to src folder and create another component 'Stepdemo.js'. Add the following code in this component: 
  1. import React, { Component } from 'react'  
  2. import { Icon, Step } from 'semantic-ui-react'  
  3. import { Button,Divider,Grid,Header,Search,  
  4.   } from 'semantic-ui-react'  
  5. export class Stepdemo extends Component {  
  6.     render() {  
  7.         return (  
  8.             <div>  
  9.                 <div class="ui blue inverted three item menu">  
  10.                     <a class="item">Semantic UI Step</a>  
  11.                 </div>  
  12.                  <Step.Group size='small'>  
  13.                     <Step>  
  14.                         <Icon name='truck' />  
  15.                         <Step.Content>  
  16.                             <Step.Title>Shipping</Step.Title>  
  17.                             <Step.Description>Choose your shipping options</Step.Description>  
  18.                         </Step.Content>  
  19.                     </Step>  
  20.   
  21.                     <Step active>  
  22.                         <Icon name='payment' />  
  23.                         <Step.Content>  
  24.                             <Step.Title>Billing</Step.Title>  
  25.                             <Step.Description>Enter billing information</Step.Description>  
  26.                         </Step.Content>  
  27.                     </Step>  
  28.   
  29.                     <Step disabled>  
  30.                         <Icon name='info' />  
  31.                         <Step.Content>  
  32.                             <Step.Title>Confirm Order</Step.Title>  
  33.                             <Step.Description>Verify order details</Step.Description>  
  34.                         </Step.Content>  
  35.                     </Step>  
  36.                 </Step.Group>  
  37.             </div>  
  38.         )  
  39.     }  
  40. }  
  41.   
  42. export default Stepdemo  
 Add a reference of this component in app.js file
  1. import React from 'react';  
  2. import './App.css';  
  3. import Stepdemo from './Stepdemo'  
  4. function App() {  
  5.   return (  
  6.     <div className="App">  
  7.       <Stepdemo/>  
  8.     </div>  
  9.   );  
  10. }  
  11.   
  12. export default App;  
Now, run the project by using 'npm start' command and check the result.
 
How To Use Semantic UI Loader And Stepper In ReactJSHow To Use Semantic UI Loader And Stepper In ReactJS

Summary

 
In this article, you learned  semantic UI Loader and stepper components of semantic UI in a ReactJs application.