Hands-on Practice I

UserProfile Card Challenge and Solution

Our Goal : User Profile App

UserProfile Card App

A step-by-step guide to implementing a React User Profile App

Step 1. Setup the React App

  1. Open a terminal and create a new React app:

  2. Install the Bootstrap package:

  3. Import Bootstrap into the index.js file:


Step 2. Create the Parent App.jsx Component

  1. Open src/App.jsx and set it up to include the child UserProfile component.

  2. Here is the updated App.jsx:


Step 3. Create the Child UserProfile.jsx Component

  1. Create a components folder in the src directory and add a file named UserProfile.jsx.

  2. Implement the UserProfile component:


Step 4. Add Custom Styles (Optional)

  1. Create a src/App.css file to add custom styles :


Step 5. Test the Application

  1. Run the app:

  2. Open the browser and navigate to http://localhost:5173. You should see the user profile displayed with the image on the left and name, email, and bio on the right.


6. Folder Structure Overview

After implementation, your folder structure should look like this:


This app now uses Bootstrap CSS for styling and follows the structure you described. You can customize further as needed!

Last updated