Skip to content

Files

Latest commit

c9f02c7 · Jan 3, 2025

History

History

ProfileAPI

Random User Card Component(API)

This React component (Card.js) fetches random user data from the Random User API and displays it in a card format.

Features

  • 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

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/your-repository.git
  2. Install dependencies:

    npm install

Usage

  1. Import the Card component:

    import Card from './Card';
  2. Include the Card component in your JSX:

    <Card />

Example

import React from 'react';
import Card from './Card';

const App = () => {
  return (
    <div>
      <h1>Random User Card</h1>
      <Card />
    </div>
  );
};

export default App;