Open In App

React Suite Placeholder Paragraph

Last Updated : 25 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application.

In this article, we’ll learn about React suite Placeholder Paragraph. The placeholder component is used to display the initial state before the component is loaded. Placeholders can also be added in the form of paragraphs along with different shapes like circles, squares, etc.

Syntax:

function App() {
      const { Paragraph } = Placeholder;
    return (
         <Paragraph rows={5} />
      );
}

Creating React Application And Installing Module:

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

npm create-react-app projectname

Step 2: After creating your project, move to it using the given command:

cd projectname

Step 3: Now Install the rsuite node package using the given command:

npm install rsuite

Project Structure: Now your project structure should look like the following:

 

Example 1: Below example demonstrates the basic implementation of the placeholder paragraph.

Javascript




import { Placeholder } from "rsuite";
import "rsuite/dist/rsuite.min.css";
  
export default function App() {
  
    const { Paragraph } = Placeholder;
  
    return (
        <center>
            <div>
                <h2>GeeksforGeeks</h2>
                <h4 style={{ color: "green" }}>
                    React Suite Placeholder Paragraph
                </h4>
                  
                <div style={{ marginTop: 20, width: 800 }}>
                    <Paragraph style={{ marginTop: 30 }} rows={4} />
                </div>
            </div>
        </center>
    );
}


Output:

 

Example 2: Below example demonstrates the placeholder paragraph with different shapes.

Javascript




import { Placeholder } from "rsuite";
import "rsuite/dist/rsuite.min.css";
  
export default function App() {
  
    const { Paragraph } = Placeholder;
  
    return (
        <center>
            <div>
                <h2>GeeksforGeeks</h2>
                <h4 style={{ color: "green" }}>
                    React Suite Placeholder Paragraph
                </h4>
                  
                <div style={{ marginTop: 20, width: 800 }}>
                    <Paragraph style={{ marginTop: 20 }} 
                        graph="square" rows={3} />
                    <Paragraph style={{ marginTop: 20 }} 
                        graph="circle" rows={3} />
                    <Paragraph style={{ marginTop: 20 }} 
                        graph="image" rows={3} />
                </div>
            </div>
        </center>
    );
}


Output:

 

Reference: https://rsuitejs.com/components/placeholder/#paragraph



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads