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. Steps help to create a navigation bar that guides users through the steps of a task.
React Suite Steps Small is simply used to create smaller steps.
Syntax:
<Steps current={1} small> <Steps.Item title="Text" description="Description" /> </Steps>
Let’s learn more about this using an example
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 create Steps for publishing an article on GFG using React suite Steps.
Javascript
import React from 'react' ; import Steps from 'rsuite/Steps' ; import 'rsuite/dist/rsuite.min.css' ; function App() { return ( <div> <h1 style={{ color: 'green' }}> neveropen </h1> <h3>React Suite Steps Small</h3> <Steps current={0} small> <Steps.Item title= "Pick Article" description= "You need to pick the article" /> <Steps.Item title= "Pending Review" description= "Write article, and submit it for review" /> <Steps.Item title= "In-Review" description= "Reviewers checks your article" /> <Steps.Item title= "Published" description= "Article is published" /> </Steps> </div> ) } export default App; |
Step to Run Application: Run the application using the following command from the root directory of the project:
npm start
Output: Now open your browser and go to http://localhost:3000/, you will see the following output:
Example 2: In this example, we will learn, how to create small steps with icons.
Javascript
import react from 'react' import Steps from 'rsuite/Steps' ; import 'rsuite/dist/rsuite.min.css' ; 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' }}> neveropen </h1> <h3>React Suite Steps Small</h3> <Steps small> <Steps.Item title= "Step 1" icon={<ExploreIcon style={{ color: 'red' }} />} description= "I am Red step " /> <Steps.Item title= "Step 2" icon={<InfoOutlineIcon style={{ color: 'green' }} />} description= "I Green step " /> <Steps.Item title= "Step 3" icon={<ReviewIcon style={{ color: 'blue' }} />} description= "I Blue step " /> <Steps.Item title= "Step 4" icon={<ReviewPassIcon style={{ color: 'orange' }} />} description= "I Orange step " /> </Steps> </div> ); } |
Output:
Reference: https://rsuitejs.com/components/steps/#small