This React component (Card.js
) fetches random user data from the Random User API and displays it in a card format.
- Fetches random user data using the Random User API.
- Displays user's name, email, city, and country.
- Allows user to fetch a new random user on button click.
- Demo : Simple Profile Card
-
Clone the repository:
git clone https://github.com/your-username/your-repository.git
-
Install dependencies:
npm install
-
Import the
Card
component:import Card from './Card';
-
Include the
Card
component in your JSX:<Card />
import React from 'react';
import Card from './Card';
const App = () => {
return (
<div>
<h1>Random User Card</h1>
<Card />
</div>
);
};
export default App;