![]() |
VOOZH | about |
When data is not yet loaded, a Skeleton Component serves as a placeholder preview for the user. Material UI for React provides an easily integratable version of this component, and in React JS, the following approach can be employed to utilize the Skeleton Component.
Step 1: Create a React application using the following command:
npx create-react-app foldernameStep 2: After creating your project folder i.e. foldername, move to it using the following command:
cd foldernameStep 3: After creating the ReactJS application, Install the material-ui module using the following command:
npm install @mui/materialProject Structure:
Example 1: In this example, we will create a Skeleton component for a text, rectangular and circular variants. Please update App.js like below.
Step to Run Application: Run the application using the following command from the root directory of the project:
npm startOutput: Now open your browser and go to http://localhost:3000
Example 2: In this example, we will create Skeleton components having different animations. Please update App.js like the below.
Steps to Run the application:
npm startOutput: