Build a User Directory app in React that demonstrates:
• Axios (HTTP requests)
• fetch (browser-native API)
• Conditional rendering
• Dynamic user interface updates
https://jsonplaceholder.typicode.com/users
Display each user with the following:
• Name
• City (from address.city)
• On page load: Fetch and display 5 users using fetch.
• On button click ("Load More Users"): Fetch the next 5 users using axios.
✔ This demonstrates understanding of both methods.
npm install # Install dependencies
npm run dev # Start development server
# Open http://localhost:5173
1.Initial Load - 5 users display automatically using fetch()
2.Search Users - Type to filter by name or email
3.Show Details - Click button to reveal phone & website
4.Load More - Click to fetch next 5 users using Axios
5.Responsive - Resize browser to see mobile layout
• Add a "View Details" button on each user card that toggles more info:
• Phone
• Website
• Add loading and error UI states:
• e.g., “Loading...”, “Failed to fetch users.”
• Implement pagination-style loading (5 users at a time).
• Add a search input to filter users by name or email.
📚 User Directory App
🔍 [ Search Users... ]
------------------------------------------------
👤Name: Leanne Graham
📧 Email: Sincere@april.biz
🏙 City: Gwenborough
[ View Details ]
📞 Phone: 1-770-736-8031 x56442
🌐 Website: hildegard.org
------------------------------------------------
[ Load More Users ]
|-------------------------------|
| User Directory App |
|-------------------------------|
| [Search Input] |
|-------------------------------|
| List of Users |
|-------------------------------|
| [Load More Users Button] |
|-------------------------------|
Topic - Applied In
fetch - Initial API call (first 5 users)
Axios - "Load More" fetch (next 5 users)