Open In App

React Suite Steps Vertical

Last Updated : 17 Jun, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. A navigation bar that takes users through the steps of a process is called Steps.

The React Suite Steps Vertical helps us to create steps in the vertical direction. We just need to mention vertical in the Step attribute. 

Syntax:

<Steps current={index} vertical>
   <Steps.Item title="Some title" 
           description="Some description" />
</Steps>  

Creating React Application And Installing Module:

Step 1: Create a React application using the following command:

npx create-react-app foldername

Step 2: After creating your project folder i.e. foldername, move to it using the following command:

cd foldername

Step 3: After creating the ReactJS application, Install the required module using the following command:

npm install rsuite

Project Structure: It will look like the following.

 

Example 1: Now write down the following code in the App.js file. Here, App is our default component where we have written our code.

In this example, we will learn how to How cook Tea using React Suite vertical steps.

Javascript




import react from 'react'
import Steps from 'rsuite/Steps';
import 'rsuite/dist/rsuite.min.css';
  
export default function App() {
    return (
        <div className="App">
            <h1 style={{ color: 'green' }}>
                GeeksforGeeks</h1>
            <h3>React Suite Steps Vertical</h3>
            <h6 style={{ color: 'red' }}>
                How to cook Tea?</h6>
            <br></br>
            <Steps current={5} vertical >
                <Steps.Item title="Water" 
                    description="Boil some water" />
                <Steps.Item title="Add Tea Leaves" 
                    description="Add Tea Leaves to the boiling water" />
                <Steps.Item title="Add Milk" 
                    description="Add some Milk" />
                <Steps.Item title="Boil" 
                    description="Boil for sometime" />
                <Steps.Item title="Enjoy" 
                    description="Enjoy your Tea" />
            </Steps>
        </div>
    );
}


Step to Run Application: Run the application using the following command from the root directory of the project:

npm start

Output:

 

Example 2 In this example, we will create vertical steps and provide colorful icons to all these vertical steps

Javascript




import react from 'react'
import 'rsuite/dist/rsuite.min.css';
import Steps from 'rsuite/Steps';
  
import ExploreIcon from '@rsuite/icons/Explore';
import InfoOutlineIcon from '@rsuite/icons/InfoOutline';
import ReviewPassIcon from '@rsuite/icons/ReviewPass';
import ReviewIcon from '@rsuite/icons/Review';
export default function App() {
    return (
        <div className="App">
            <h1 style={{ color: 'green' }}>GeeksforGeeks</h1>
            <h3>React Suite Steps Vertical</h3>
  
            <Steps vertical >
                <Steps.Item title="Step 1" 
                    icon={<ExploreIcon style={{ color: 'red' }} />}
                    description="Hi Geek! I am vertical step 1 " />
                <Steps.Item title="Step 2" 
                    icon={<InfoOutlineIcon style={{ color: 'green' }} />}
                    description="Hi Geek! I am vertical step 2" />
                <Steps.Item title="Step 3" 
                    icon={<ReviewIcon style={{ color: 'blue' }} />}
                    description="Hi Geek! I am vertical step 3" />
                <Steps.Item title="Step 4" 
                    icon={<ReviewPassIcon style={{ color: 'orange' }} />}
                    description="Hi Geek! I am vertical step 1 4" />
            </Steps>
        </div>
    );
}


Output:

 

Reference: https://rsuitejs.com/components/steps/#vertical



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads